Well if we're playing with assumptions on anecdotes...
I went to two majority-female universities over the course of seven years in the 90s for several pieces of paper. In my STEM courses, females were a huge minority. Of the students in my courses, they often were among the top scorers.
MY observations were that the majority of the women I talked to on campus has no interest in STEM stuff. A decent amount of the men that were in my courses were in it because they were expected to have went into it, or thought it would be a well paying job. The majority of the women in my courses were in it because they enjoyed the field and felt they had talent in it.
My conclusion would be that the girls in STEM wanted to be there, were driven to succeed in there, and it showed. Some of the guys just 'expected' to pull out 'a pass' and it also showed. The women that couldn't hack it dropped out, and the men that couldn't hack it stayed until they failed out. End result: the women in the courses placed rather well, but in no way meant that the majority of women 'secretly want to be in STEM and we are losing top engineers/coders because of it'. I've no doubt that there are some women who would have flourished had they chosen a different major, but I looked it as more that 'too many men thought they could take a piece of the 'new rising field''.