It did not "just happen". As with certain other species, sexual differentiation occurred as it provided those species with a biological advantage in their enviornment.
How did they both evolve at the same place and the same time to the same point to be together and be the beginning of God-breathed humanity.
If you are trying to reconcile evolution with belief in Scripture, this has to be addressed, because it is the crux of the matter, IMO.
The number of years God took to create the universe is not finally the point. It is, who man is, how he came to be, if he sinned, and most importantly, Jesus' coming to earth as a human (God made flesh), and dying for Adam's sin, and for us all.
I have not seen anything to satisfactorily address that fundamental problem with theistic evolution.