Richard F. looked into this one for you. He had to wait for a rainy day to ask a worm.
That's an interesting question, Trevor. Worms need to breathe air to live. When the soil is dry, there is air in the spaces between the soil particles. So, the worms can breathe, even underground. There might not be enough air for you, but there's plenty for a little worm. But when it rains, the spaces in the soil start to fill up with water. The worms have to come up to the surface so they won't drown. After the rain stops, when the soil starts to dry up, the worms dig their way back underground where they live.
The Compton's Interactive Encyclopedia had this to say about worms
Adult animals that have soft, elongated, often tubelike bodies and that lack backbones are commonly called worms. Worms are so different from one another that zoologists do not classify them together in a single group; they place them in about a dozen different and often unrelated taxonomic groups called phyla. In everyday language the name worm may be loosely applied to other animals as well-to the larvae, or immature forms, of some insects, for example, or even to some vertebrates, such as the blindworm, a limbless, snakelike lizard. However, the name is properly applied only to certain adult invertebrates. Worms play a major role in virtually all ecosystems. Some terrestrial worms condition the soil. Many worms are parasites of plants and animals, including humans. Many free-living, or nonparasitic, worms form an important link in food chains.Back to