single cells used to simply miosis
eventually mitosis evolved probably in multicellular organisms
these were most likely hermaphrodidic
As larger and more complex multicellular life evolved you get sexes and sexual dimorphism
as babies must be produced by the female it makes sense that her reproductive organs are inside which requires males to evolve a way of reaching it during mating
millions of years later after countless generations you arrive at human reproduction and you get me shoving my dong into your mom