Dependence on good income: if you are not dependent on a good income, you have more jobs to choose from.
For example you can study literature, or work with children. Another option only women have is becoming a mother, staying at home or working only part time. Some men do that, too, but as a man you can not really count on making that your career. Mothers have the first choice of staying home or not (because they have the wombs).
Other things, like being more sociable, might be affected by biology. I am not sure. Maybe being more popular as a kid makes people more inclined to take up a people facing job.
I love maths, and even I find it difficult to stay focused on it if I am not forced to do so. Maybe it is different for other people, but I could imagine that is also a factor that makes women drop out. Not because they don't like STEM, but because they don't have the pressure to stay in it.
Another way to think about it: what do women do who don't go into STEM? We are trained now to think that they fail in life, but the reality is that they usually go on to do other interesting things.
I have had female colleagues in IT who told me they would try this now, and they could always drop out and have kids if they don't like it. Only one of them stayed in tech, and she became a teacher. That was in a job where they ended up putting the IT staff into the basement, while marketing and HR resided on the first floor with big windows. Not the only time I witnessed that attitude towards tech workers.