The following link shows that in mathematics and statistics the number of females is more balanced than in physics and engineering. I know people say that females do not like for example computer science because they are afraid of difficult subjects. But that explanation does not explain why females continue to major in mathematics.

https://www.aps.org/programs/education/statistics/womenmajors.cfm