They eat a ton also.On a broad enough level, everything ferments it's food - we have gut bacteria that help us digest things. Anytime anyone talks about probiotics, they're talking about supplementing their gut fauna.
Even the most effective digestive tracts do a pretty poor job of digesting food - ruminants poo a ton. Fermenting the food (using different bacteria/yeast) helps to break down some things that the animal can't break down themselves. If you could find the right fungus/bacteria, and enough time, you could feed animals almost anything (there are fungii that break down motor oil into simple sugars, fungii that break down plastics, etc)
When you look at the "food to poo ratio " they poo a fraction of what they eat.
Example --
A milking dairy goat at my place putting out 2 gallon of milk per day (1 gallon per milking) will eat 2 to 2.5 lbs of grain and around 10 lbs of hay and pasture a day.
There is a lot more going in than whats coming out.