When animals are kept in confinement, and their waste treated in anaerobic lagoons, a great deal of the nutrients, especially the nitrogen in their wastes is lost. Some of the nitrogen leaks through the bottom of the lagoons (especially older unlined lagoons) and puts nitrates in the aquifer underneath. Nitrates in drinking water causes blue baby syndrome, a condition where infants cannot get enough oxygen. They can suffer brain damage and even die as a result of drinking nitrates.
A larger proportion of the nitrogen in the lagoons converts to ammonia, which evaporates and then is deposited downwind. As you can see in the figure below, high concentrations of ammonia are found in rainwater near and downwind of livestock feeding operations in the United States.
Because the wastewater loses its nitrogen to the air, the remaining wastewater has lost its natural balance of nitrogen to phosphorus. When it is finally used to fertilize fields, the application rates are determined by the amount of nitrogen, rather than phosphorus. This means that too much phosphorus is applied, sometimes having a toxic effect on the soils. To treat this problem, farmers use artificially made concentrated ammonia to replace the ammonia lost in lagoons, and to bring the nitrogen to phosphorus ratio back to levels that are needed to grow crops.
Much of the ammonia that goes downwind eventually finds its way to the Gulf of Mexico, where it causes algal blooms and eventually leads to hypoxia (low oxygen) or anoxia (lack of oxygen). The work of Nancy Rabelais shows that the area of anoxia in the Gulf of Mexico has expanded to cover 20,000 square kilometers. Roughly half the artificially produced ammonia added to fields in the USA eventually contributes to the eutrophication problem.
The figure below shows the typical nitrogen cycle on a pig farm in the United States.
Although these problems are most obvious where anaerobic lagoons are used to manage wastes, similar problems occur when growing poultry, which does not use lagoons but manages the wastes as solids. The ammonia coming from a chicken coop is easy to detect with the naked nose!
There are at least three ways to fix this problem: