Earthworms are a gardener's friends. They eat decomposing plant material from the surface of the soil, sometimes taking pieces down into their burrows to devour. This digested matter is called "castings." Worm castings are nutrient rich and are in a form that is readily available to plants.
The tunnels worms create in the soil are passageways for oxygen, water and dissolved nutrients to reach plant roots directly. As worm tunnels collapse and more are created, topsoil is turned, mixed and enriched. A healthy worm population in the vegetable garden translates into rich soil. Three main types of worms populate average soil.
Nightcrawlers are large earthworms, so named because they surface at night. They leave mounds of castings at the openings of their tunnels, creating an eyesore if they populate a lawn. Some gardeners gather the mounds with a shovel and bucket for use in the garden. Nightcrawlers are most active in the spring and fall, when they live closer to the surface of the soil. When the summer heat comes, they move deeper into the soil where it is cool and moist. They tend to prefer soil that is shaded by lawn or plant cover and not open to the hot sun.
Nightcrawlers are not common in garden soil that is regularly disturbed by cultivating. They may appear near compost piles or in perennial beds, but you probably won't find them in a tilled garden. Nightcrawlers are slow to reproduce and they need special care, so they are not raised commercially.
Field worms are also called garden worms. They are smaller than nightcrawlers and are found in cultivated areas as well as in lawns and woodlands. They are not productive breeders, so they are not raised commercially. Field worms are valuable soil builders due to their natural tunneling activity.
Commercial worm production relies on two similar types of manure worms, redworms and red wigglers. Both adapt to a variety of growing conditions. Manure worms eat organic matter in any stage of decomposition; they are the type found throughout a compost pile, eating any organic matter available. They are prolific breeders. Some gardeners raise manure worms in vermiculture bins, where organic waste is fed to them to be turned into castings for fertilizer.
Although you can collect worms from the garden, purchase breeder worms if you want to populate a vermiculture bin. You need worms of the same species for successful breeding in the bin. And you want the most efficient compost producers in your bin.
You will want to keep these in the compost bin rather than in the garden, because they eat vegetable and ornamental plants.