Honestly, I think most of these things are essentially tribal. A great source of data to support this idea is the 2015 table of physicians by gender and subspecialty [1]. Why are neurologists 28% female while neurological surgeons are only 7.8% female? Why are women 5% of orthopedic surgeons by 11.3% of vascular surgeons? You can come up with all sorts of just so stories (oh it's the hours, it's the blood) but then oops women make up 26.6% of emergency medicine specialists, so guess it's not hours or gore... What I see in math is that people flock to people to either are like them, or are nice to them, or to people who'll hire them. If you're deciding on your surgery specialty and the vascular surgeons will talk with you and the orthopedic surgeons snub you, you'll probably go for vascular surgery. It's certainly what happened in math grad school; if the numerical analysts were mean to women and the combinatorists were cool and said grad students only had to pay $5 for seminar dinners and weren't mean, magically combinatorics had more women (and more men, too, because this also applies to dudes!). If you get your first software dev job out of college and all the guys sort of avoid you and won't talk to you and wonder why you're there instead of raising your non-existent family, maybe... you'll end up somewhere else. Life is short.
Women make up the majority of house cleaners. It's not because women are so in love with cleaning, it's because it's a flexible job you can get into through another (often female) contact that will sometimes let you bring your five-year-old kid along so you don't need childcare. Longhaul trucking won't, in general, let you bring your five-year-old kid along so you don't need childcare (you really can't stop for potty often enough), and many blue collar jobs men hold are also gotten by family and neighborhood contacts.
Women make up the majority of house cleaners. It's not because women are so in love with cleaning, it's because it's a flexible job you can get into through another (often female) contact that will sometimes let you bring your five-year-old kid along so you don't need childcare. Longhaul trucking won't, in general, let you bring your five-year-old kid along so you don't need childcare (you really can't stop for potty often enough), and many blue collar jobs men hold are also gotten by family and neighborhood contacts.
[1] https://www.aamc.org/data-reports/workforce/interactive-data...