There are theories about poo eating- some speculate dogs do it to get valuable digestive enzymes, probiotics or a nutrient they are lacking. There are several animals that have to do it because their digestive systems don't work well enough to get nutrition from food with one pass.Rabbits and Flying Foxes come to mind.
Unfortunately some dogs seem to do it because they like the taste- agggghhh. If you have a dog who does it, try feeding them and other dogs in the household pineapple. It is said to make the droppings unpalatable.

Louise - your question about why do they roll in poo. You know dogs are predominantly carnivorous, they hunt in packs. They roll in poo so they don't smell like a dog to their prey and can sneak up on them.
It is gross, but most carnivores eat their prey's stomach contents first- that is one way of getting vegetable matter in their diet. Feeding a dog only meat does not give them a natural balanced diet which may be another reason dogs eat grass.

Hi there. Dogs eat grass for a few reasons. Yes sometimes because they have an upset tummy but more commonly because dogs are omnivores they need vegetables in their diet and know when they are lacking so they help themselves.

I have observed my dog and she will eat a little sometimes. I think this is when she needs a little digestive aid. If she eats a lot it will make her vomit. I guess at times something doesn't agree with her and she knows it needs to come out.
Interestingly I watched my older dog teach her to eat grass. He started doing it and she copied, watching him the whole time to see if she was doing it right. It made me wonder if it is instinctive or learnt.