One of the disadvantages of sexual reproduction is that one requires a mate. In species where individuals tend to be widely-separated and so are unlikely to encounter each other during their fertile periods,
hermaphroditism is relatively common. A
hermaphrodite is an organism that possesses functional male
and female reproductive organs. Many snail species (Phylum Mollusca) are hermaphroditic, for example, as are earthworms (Phylum Annelida).

Earthworms (Phylum Annelida) mating. Earthworms are hermaphrodites,
and when they mate, each worm inseminates the other.