Diatomaceous earth is primarily used as an insecticide that operates by puncturing the exoskeleton of insects that come in contact with it. Though deadly to insects, diatomaceous earth is not significantly harmful to humans or other large organisms.
Diatomaceous earth is composed of the fossilized remains of diatoms, a class of microscopic plankton. These plankton have hard casings around their bodies that are left over after the cells inside die out. During the process of fossilization and erosion, these shells break into sharp, microscopic fragments that resemble tiny shards of glass.
Insects that come into contact with diatomaceous earth are penetrated by these fragments, which work their way into the exoskeleton of the insect and leave open holes to the environment. Once the exoskeleton has been punctured sufficiently, an affected insect cannot keep enough of its bodily fluids inside of itself to survive, eventually dying from dehydration. However, these microscopic shards do not injure large organisms enough to cause any ill effects, even if small amounts of diatomaceous earth are eaten. It is common for diatomaceous earth to be mixed with grains during storage for this reason, as it prevents insects from consuming the grain but does not hurt the people or animals who eventually eat it.