It's part of the problem, but not all of the problem.
There are plenty of women who want to be in STEM fields, and have pushed for that in spite of everything. It's hard to actually get into a STEM job as a woman, regardless of education or experience, because of various biases in hiring. Once in, there are so many ways that the workplace is hostile to women, and the industry even more so. That leads to a high rate of just giving up, and changing career. There's only so much bullshit you can take before just deciding that, even though you love the work, it just isn't worth your sanity.
Working in a technical role in a non-tech company is often orders of magnitude better. Just like it is in many other respects, because tech companies are just horrifically broken in so many ways.