Why do chimps eat dirt?

From Nature:

Chimp Chimpanzees in Uganda have been spotted eating dirt along with fistfuls of leaves. This might help to increase the plants’ anti-malarial properties, say researchers. Many animals, including humans, are known to deliberately eat soil, a practice called geophagy. Though the animals and people might not be aware of it, the main reason for this is that munching on dirt can have health benefits. Soil contains scarce minerals, such as iron, and can counter diarrhea, absorb toxins, and facilitate digestion. Eating earth can also reduce hunger pangs during famine.

Now, it seems that soil might also boost the pharmaceutical properties of foods.

Sabrina Krief, a veterinarian at the National Museum of Natural History in Paris, noticed that chimpanzees in Kibale National Park often ate soil shortly before or after eating the leaves of Trichilia rubescens . After finding that the leaves contained novel anti-malarial compounds, the researchers suggested that the apes were self-medicating.

More here.