Leaf-feeding caterpillars greatly enrich their intestinal flora by eating soil. It's even possible to trace the legacy effects of plants that previously grew in that soil through bacteria and fungi in the caterpillars.