The front section of an earthworm's segmented body contains the wedgelike prostomium, which allows the worm to push into tiny cracks in the soil, widening them as it goes. The earthworm is covered with a layer of lubricating slime, and each successive segment is covered with tiny, stiff hairs that can be raised and lowered independently. To move through the soil, the worm anchors the back half of its body by extending the bristles, before pushing the front half of its body forward.
Earthworms consume a mix of soil, tiny pieces of rock and organic matter like dead leaves and roots as they move through the soil. Soil and dead plant matter are crushed in the gizzard using muscular contractions and the tiny stones in much the same way as happens in a bird's gizzard. The material then moves into the intestines, where enzymes digest it and absorb necessary nutrients. The remains are excreted, along with waste products from the worm's body, resulting in a valuable soil amendment.
Though each earthworm is hermaphroditic, with both male and female reproductive parts, they do not generally self-fertilize. Instead, two earthworms exchange sperm with each other. The sperm mixes with female ova inside the girdlelike clitellum, and the earthworm wriggles free from the structure, leaving it behind as a sort of cocoon. Young earthworms develop inside the sloughed-off clitellum and emerge from their eggs after a few weeks of gestation.
Instead of using lungs, earthworms breathe through their skin, absorbing oxygen and releasing carbon dioxide through the process of diffusion. This process only works when the earthworm's skin is moist, so earthworms use a patch of light-sensitive skin to avoid surfacing during the day, when the sunlight would dry them out. Instead, they tend to surface at night, when the air is cool and damp, or when it rains, saturating the soil and displacing air pockets.