There has been an enormous amount of work put into these questions. It is clear that there is some variation between genders in both physical and mental capability. However, it is ALSO clear that variation within genders far, far exceeds variation between genders. Like, it's not even close.
What small variation has been detected between genders is not adequate to explain the massive variation seen in gendered employment like nursing, secretaries, CEOs, programmers.
Millennia of treating women as property, the fact that e.g. women's suffrage was not widely implemented until the 20th century, the frequency with which traits seen as universal 'jump' genders, and similar indicators offer a promising avenue for an alternate explanation.