Physiology
Earthworms are hermaphrodites, meaning that they have both male and female reproductive organs. Typically, they have two pairs of testes and two to four pairs of seminal vesicles. These vesicles are responsible for the production and storage of sperm, eventually releasing them via the male pores. They also have ovaries, which release eggs via the female pores. Both units work in conjunction during copulation.
Copulation
When worms are ready to mate, which is typically around 60 to 90 days after their births, they will undergo copulation with another worm. The worms will swell with a reddish color and meet, overlapping each other's bodies. They will then squeeze together slightly and exchange sperm, which is stored until actual reproduction occurs sometime after the worms have separated.
Reproduction
With the mating worm's sperm in place, a ring around one segment of the worm will swell with eggs. This band is known as the clitellum and will act as a cocoon. When the clitellum swells with enough eggs, the earthworm will shed it while injecting its sperm. This results in a tiny, lemon-shaped cocoon that will harbor the embryonic worms until they emerge as fully formed miniature versions of their parents.
Asexuality
Some species of earthworm are asexual, using their own sperm to fertilize their own eggs. The baby worms that emerge from the clitellum will be perfect clones of their parent with the exception of a possible mutation in the bunch. This action is known as parthenogensis.