Earthworms, belonging to the phylum Annelida, are tubed-shaped segmented worms. They are found in soils throughout the world. These decomposers (organism that feeds on decomposing organic matter) have over 7,000 species dominating the earth. Earthworms are very beneficial to soil and should be encouraged into your garden.
They feed on plant debris and dead matter which breaks down to nitrogen in their casts (excretion from the earthworms), making it readily available to plants. When they die, their bodies decompose and add to improve the nutrient availability in soil.
With the extensive burrowing by earthworms, the soil is loosened and becomes aerated, improving drainage in the soil which promotes healthy root growth in plants.