How can it be both when people are naturally born male and female? If both were natural, then people would be born with a vagina and a penis.
Quite easily, and unabiguously (mygod; look out your window; it exists to a great degree.)
And what are the mechanisms? Moms. Gender in early fetus development is highly ambiguous, until certain events in the womb. That's a known fact. And it has measurable results, based on birth order studies that show patterns that completely debunk the possibility that random choice is a factor.
BTW: while rare, indeed many are born with both genetalia. Google "hermaphrodite."