A lot of sibling comments stick to the "gender equality paradox" while forgetting all the other research on the topic (this is already a heavy selection bias). Yes, women in Scandinavia and women is Bangladesh, given the chance to pursue a career in STEM, might make choices that superficially support the notion that women self-select out of tech. But this line of reasoning forgets to compare what other choices/opportunities the women in those two countries have and similarly does not compare this to the background rates for these choices in the population at large. It is rife with interesting statistical fallacies that are worthwhile to discuss.
Well but that is the point isn’t it. Women in poor, unfree countries go into tech because it makes a huge difference to their personal finances and comfort. In Scandinavia everyone lives in freedom and comfort, so you can work with something you actually enjoy instead.
Certainly, that is a big part of it. But this should be carefully compared to the "background signal" in these cultures. To take it to an extreme: how certain are you that men go into STEM for reasons different than boys being told "STEM is for boys". Both young boys and young girls have that "common sense" imposed on them by our culture, so it is very unreliable to claim that any choice is unrelated to that cultural experience as a child.