Though their numbers are growing, only 27 percent of all students taking the AP Computer Science exam in the United States are female. The gender gap only grows worse from there: Just 18 percent of American computer-science college degrees go to women. This is in the United States, where many college men proudly describe themselves as “male feminists” and girls are taught they can be anything they want to be.

Meanwhile, in Algeria, 41 percent of college graduates in the fields of science, technology, engineering, and math—or “STEM,” as it’s known—are female. There, employment discrimination against women is rife and women are often pressured to make amends with their abusive husbands.

According to a report I covered a few years ago, Jordan, Qatar, and the United Arab Emirates were the only three countries in which boys are significantly less likely to feel comfortable working on math problems than girls are. In all of the other nations surveyed, girls were more likely to say they feel “helpless while performing a math problem.”

So what explains the tendency for nations that have traditionally less gender equality to have more women in science and technology than their gender-progressive counterparts do?

A scatterplot of countries based on their number of female STEM graduates and their Global Gender Gap Index (y-axis), a measure of opportunities for women (Psychological Science)

According to a new paper published in Psychological Science by the psychologists Gijsbert Stoet, at Leeds Beckett University, and David Geary, at the University of Missouri, it could have to do with the fact that women in countries with higher gender inequality are simply seeking the clearest possible path to financial freedom. And often, that path leads through STEM professions.

The issue doesn’t appear to be girls’ aptitude for STEM professions. In looking at test scores across 67 countries and regions, Stoet and Geary found that girls performed about as well or better than boys did on science in most countries, and in almost all countries, girls would have been capable of college-level science and math classes if they had enrolled in them.

But when it comes to their relative strengths, in almost all the countries—all except Romania and Lebanon—boys’ best subject was science, and girls’ was reading. (That is, even if an average girl was as good as an average boy at science, she was still likely to be even better at reading.) Across all countries, 24 percent of girls had science as their best subject, 25 percent of girls’ strength was math, and 51 percent excelled in reading. For boys, the percentages were 38 for science, 42 for math, and 20 for reading. And the more gender-equal the country, as measured by the World Economic Forum’s Global Gender Gap Index, the larger this gap between boys and girls in having science as their best subject. (The most gender-equal countries are the typical snowy utopias you hear about, like Sweden, Finland, and Iceland. Turkey and the United Arab Emirates rank among the least equal, according to the Global Gender Gap Index.)

The gap in reading “is related at least in part to girls’ advantages in basic language abilities and a generally greater interest in reading; they read more and thus practice more,” Geary told me.

What’s more, the countries that minted the most female college graduates in fields like science, engineering, or math were also some of the least gender-equal countries. They posit that this is because the countries that empower women also empower them, indirectly, to pick whatever career they’d enjoy most and be best at.

“Countries with the highest gender equality tend to be welfare states,” they write, “with a high level of social security.” Meanwhile, less gender-equal countries tend to also have less social support for people who, for example, find themselves unemployed. Thus, the authors suggest, girls in those countries might be more inclined to choose STEM professions, since they offer a more certain financial future than, say, painting or writing.

When the study authors looked at the “overall life satisfaction” rating of each country—a measure of economic opportunity and hardship—they found that gender-equal countries had more life satisfaction. The life-satisfaction ranking explained 35 percent of the variation between gender equality and women’s participation in STEM. That correlation echoes past research showing that the genders are actually more segregated by field of study in more economically developed places.

The upshot of this research is neither especially feminist nor especially sad: It’s not that gender equality discourages girls from pursuing science. It’s that it allows them not to if they’re not interested.

The findings will likely seem controversial, since the idea that men and women have different inherent abilities is often used as a reason, by some, to argue we should forget trying to recruit more women into the STEM fields. But, as the University of Wisconsin gender-studies professor Janet Shibley Hyde, who wasn’t involved with the study, put it to me, that’s not quite what’s happening here.

“Some would say that the gender STEM gap occurs not because girls can’t do science, but because they have other alternatives, based on their strengths in verbal skills,” she said. “In wealthy nations, they believe that they have the freedom to pursue those alternatives and not worry so much that they pay less.”

Instead, this line of research, if it’s replicated, might hold useful takeaways for people who do want to see more Western women entering STEM fields. In this study, the percentage of girls who did excel in science or math was still larger than the number of women who were graduating with STEM degrees. That means there’s something in even the most liberal societies that’s nudging women away from math and science, even when those are their best subjects. The women-in-STEM advocates could, for starters, focus their efforts on those would-be STEM stars.

Then again, it could just be that, feeling financially secure and on equal footing with men, some women will always choose to follow their passions, rather than whatever labor economists recommend. And those passions don’t always lie within science.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.