When a worm is looking for a sexual partner, its primary criterion is length. A pair of worms slithering alongside one another, belly to belly, head to tail. Because worms are hermaphrodites–they have both sets of sexual organs–they must arrange their bodies in such a way that the male organs of one line up with the female organs of the other. These sexual organs–really just tiny pores–tend to be located around the twelfth segment, between the worm’s head and its clitellum. Once the worms are in position, the male organs release sperm, which is taken in by the female organs. For some worms, including the nightcrawler Lumbricus terrestris, the pores aren’t designed to line up precisely, and seminal fluid has to travel along a groove that is formed when the worm contracts the longitudinal muscles in its body, forcing drops of fluid towards their final destination one segment at a time. Many species have several pairs of female apertures, and copulating worms will adjust their position a few times so that sperm is deposited in each one.
–Amy Stewart, The Earth Moved: On the Remarkable Achievements of Earthworms, p. 69.