Chance determines what kind of device a species uses. The species concept is complicated. The criteria seems to be different for animals than for plants or microbes. Most microbes are asexual and many plants can produce fertile hybrids with other species. Even an individual's sex is intricate, says Charles E. Taylor, biology professor at the University of California at Los Angeles.
Most animals are male or female but snails, for example, are both.
Poppies have both a male and a female part on the same flower. Corn has them in the same plant but not the same flower. Marijuana has separate male and female plants.