Regarding soil from the earth being part of the diet: don't forget about
pica.
Pica is a behavioral response which involves eating non-food substances such as soil, sand, clay, cigarette ashes, burnt matches, coffee grounds, chalk, plaster, etc. Pica most commonly appears in young children and pregnant women. It is also found in animals.
Pica is considered an eating disorder, but may in fact be a natural instinct that kicks in when mineral levels are low, or for other reasons. Very little research has be done on it. In
this article it says:
Many young kids put nonfood items in their mouths at one time or another. They're naturally curious about their environment and might, for instance, eat some dirt out of the sandbox.
Kids with pica, however, go beyond this innocent exploration of their surroundings. Between 10% and 30% of kids ages of 1 to 6 years have the eating disorder pica, which is characterized by persistent and compulsive cravings (lasting 1 month or longer) to eat nonfood items.
The word pica comes from the Latin word for magpie, a bird known for its large and indiscriminate appetite.
Pica is most common in people with developmental disabilities, including autism and mental retardation, and in children between the ages of 2 and 3. Pica also may surface in children who've had a brain injury affecting their development. It can also be a problem for some pregnant women, as well as people with epilepsy.
As well as replenishing minerals, it's conceivable that pica might be a build-in instinct that helps populate the gut with a wide variety of bacteria from the soil at an early age.
I find it interesting that children with pica eat cigarette ashes, burnt matches and coffee grounds, as these have the approximate appearance of soil, and so it could be that this primitive pica instinct just mistakes these items for soil. One might speculate that the pica instinct may be keyed on substances that have the general visual appearance of substances that look like soil.
Another similar instinct in appears in dogs, where they start sniffing and may eat feces that they come across on the ground. Owners often try to discourage this behavior, but I have often thought that this feces eating instinct may exist in part to help populate the dog's gut with a healthy microbiome. It may be a dog's DIY bacteriotherapy.