Every animal that eats (you, cows and whales, etc.) digests its food to produce building blocks for its cells, energy and waste.
The wastes can be solids, liquids or gases - scientifically called fecal matter, urine and flatulence. Each can produce environental problems if put into the environment at a rate beyond the capacity of the environment to absorb it. A zebra's worth of waste in Africa doesn't do much, but a piggery dumping into a small stream is bad.
Lets review each of the wastes and see the impacts:
Solid Waste (AKA manure):
This is mixture of undigested food, intestinal bacteria. It can pollute soil by overloading the nitrogen content. use up all the oxygen in water to kill fish or add enough ammonia to water to poison aquatic life (fish) or over fertilize water to produce too much algae. In addition fecal bacteria (Like e-coli and PSA) can cause diseases. Needless to say, waste in water supply can make it taste funny. Most well run farms try to handle manure by scientific spreading on fields or by mechanical treatment
Much the same as solid waste with its high nitrogen ammonia levels. Bad for fish and too good for algae.
This gets interesting. The flatulence from ruminants (cattle etc.) contains high levels of methane because their guts convert cellulose to starches and sugars. Methane is a powerful greenhouse gas, 21 times as bad for the environment as carbon dioxide. The methane generation rate is dependent on what the cow eats - some foods are gassier than others. Experts in agriculture spend a lot of time devising the best, least gassy diets for cows.