I was raised on a dairy farm in Texas and there are a few stipulations concerning the well placement wrt the dairy barn to prevent coliform contamination of the water supply. Mostly, it had to be more than 200 ft. (I think) away from the barn and the barn had to be situated so that it drained in a different direction. We also had to have a catch pond for the barn runoff (it smelled real nice!), to filter the wastes before it flowed to the general landscape.
As far as pesticides and herbicides, we used plenty, many of which are now illegal (think agent orange), and never had any traces of them in our water (it was tested regularly in order to maintain our “grade A” certification.
As an aside, we had our well site “dowsed” before digging it, because all the neighbors (both of them!) insisted it was necessary. My dad did it just for the heck of it. Sure enough, there was plenty of water. We never had our well dry up, even during severe droughts, and a dairy uses copious amounts of water. A few years later, we rented a backhoe and dug a 20 foot deep pit in a pasture about 500 yards from the well, but in the same creek valley. The pit promptly filled up with water and we irrigated about 80 acres of pasture from it for the next 3 years without noticing a drop in the water level. Moral: any idiot can dowse water in a spring fed creek valley.