Earthworms eat dead plants and animals. When they eat, they also take in soil and tiny pebbles. They take in nutrients from microorganisms in the material they ingest. Earthworms then excrete wastes in the form of casts. Casts are rich in nutrients like nitrogen, phosphorus, and potash. In addition to breaking down organic materials and adding nutrients to the soil, earthworms also help loosen the soil so air can circulate. This helps plants grow.