Poop is the digestive system’s waste. It’s all the bits that the stomach and intestines did not actually digest, instead passing it along for eventual disposal. So since it’s already faced this first round of rejection, it’s surprising that any animal would view poo as a food source, but many animals either supplement or even sustain themselves by practicing coprophagia (eating poo).
A matter of nutritional efficiency
Dung beetles, of course, depend on poop for sustenance. Baby beetles focus on solid, underdigetested materials, while adults focus on extracting nutrient-rich liquids, making something like a cow pie a meal for the whole family. The reason such nutrients are available is because no digestive system is perfectly efficient, and the beetles then benefit from catching what the original diner missed, so to speak. Seeds are especially hard to digest, as it helps them survive digestive tracts to be scattered and planted away from their parent plant.
Rabbits (and other lagomorphs) have also evolved around the expectation of eating feces, but in their case they eat their own. Again, their digestive tract doesn’t extract all the nutrition out of their regular diet, and so at night they make cecotropes, or “night feces.” These are especially nutrient rich and are the rabbit’s way of keeping good food from going to waste.
Just like mom used to make
Dung beetles actually help clean up poo, and rabbits are discrete enough to eat their cecotropes at night, so it’s easier to look the other way on this behavior than when dogs do it. Aside from the gross factor in a pet that likes to slobber on you dining on dung, dogs also have less of a nutritional drive to eat feces. They might smell some enticing, undigested morsels in other animals’ droppings, but they might being eating it out of custom.
Mother dogs will often lick their pups clean when they’re little, including any feces or urine that may have been excreted. As such, the puppies may just be learning that that’s something you eat. If this is the case, I think it qualifies as the most repulsive comfort food anyone’s ever heard of.
Source: Why Do Animals—Including Your Dog—Eat Poop? by Liz Langley, Weird and Wild