The two main images of jihadists in the Western media are nearly diametrically opposed. One depicts the terrorist as socially marginal. For example, Chérif Kouachi, the younger of the two brothers whose January 2015 attack on the Charlie Hebdo offices in Paris claimed 12 lives, was a would-be rapper and pizza delivery boy with a record of petty crime. Amedy Coulibaly, an accomplice who killed a policewoman and four hostages in a kosher supermarket in Paris during the manhunt for the Kouachis, had been convicted five times for armed robbery. Neither had any higher education.

The other image is of the terrorist as a highly educated expert: Khalid Sheikh Mohammed, mastermind of 9/11, holds a degree in mechanical engineering from a U.S. university. Similarly, al Qaeda head Ayman al-Zawahiri is a medical doctor. And there have also been highly educated front-line operatives: Seifiddine Rezgui, who killed 38 people on the beach of Sousse in Tunisia in summer 2005, was an electrical engineering student at a local university. In fact, of the 25 individuals directly involved in the 9/11 attacks, eight were engineers.

So are jihadists typically losers who lack the education and wherewithal to make it anywhere else, or are they highly skilled, ideologically driven operatives? A look at the social and educational profiles of past jihadists sheds light on the conditions under which they get radicalized. In Engineers of Jihad, we’ve conducted the first systematic investigation of levels and types of education of more than 4,000 political radicals operating across the Muslim world and in the West.

A man identified by a lawyer as Cherif Kouachi, one of the two brothers who killed 12 people in the attack on the weekly paper Charlie Hebdo in Paris, is seen in this still image taken from Reuters TV video shot at a Paris courthouse while facing charges of helping smuggle Islamist fighters into Iraq, March 19, 2008. Reuters Two findings about Islamist radicals stand out. First, among those who have been to university, engineers are dramatically overrepresented almost everywhere across the world and in every jihadist group. Among 207 Islamist radicals in the Muslim world whose degrees we know, 93 (or 44.9 percent) have studied engineering. Among the general populations of the relevant countries, that figure is only 11.6 percent. Among 71 Western-based Islamist radicals with known higher education, 32 have at some point been enrolled for an engineering degree, or 45.1 percent, compared with 16.2 percent in the general population of Western graduates.

By contrast, levels of education differ drastically by region: among 497 cases of militants in the Muslim world, 46.5 percent have attended university. In the Western sample of 344 individuals, the proportion is considerably lower at 25.2 percent. This is particularly striking given that rate of enrollment among the overall population of the countries we studied in the Muslim world is only 11.3 percent. In the Western countries, it is 43 percent. Taking into account these general education levels, the odds that an Islamist radical from the Muslim world has been to university are about 15 times higher than for his peers from the Western world.

Of course, our data are incomplete and there are likely to be biases: more active or senior members of radical groups, for example, are more likely to be detected and reported, hence more likely to end up in our samples. It is unlikely, however, that this can fully account for either the overrepresentation of engineers or the drastic differences in education levels between Western- and Muslim-world jihadists.

It is natural to think that jihadists in the Muslim world are so highly educated and there are so many engineers among the radicals because engineers are recruited for their technical skills. But there is no evidence for that. If we break down jihadists by their functions within groups, only 15 percent of engineers work as bomb makers, and 26 percent have communications roles. These percentages are comparable with those among other graduates in these groups. Moreover, militant leftist groups in the Muslim world, Latin America, and Europe have few or no engineers among their ranks yet have been quite effective at using lethal technologies.

We have instead found ample evidence that the strong presence of graduates in general, and engineers in particular, among Muslim-world militants is best explained through economics. Case histories of Egypt and other Arab states illustrate how radicalism among graduates first emerged in the 1970s. At that time, the Arab economies were turning south just as higher education systems were expanding and producing masses of graduates.

Graduate under- and unemployment was a gold mine for Islamist groups. Radical networks typically emerged in universities and were built around rejecting the corrupt patronage systems of the secular regimes that had held back the new graduates, students who had been promised a future as vanguards of the nation. Islamist movements made a virtue out of necessity, preaching an austere lifestyle as a sign of piety and moral rectitude and rejecting the privilege and corruption of Westernized ruling elites.

There are fewer graduates among extremists who grew up in Western countries because the social mobility that a university degree grants is much higher there. That leaves disaffected dropouts and unemployed petty criminals as the majority of fighters. Within the Muslim world itself, the share of graduates among extremists is much lower in countries that have seen no college glut and better economic development, such as Singapore, Indonesia, and India, where the figure reaches an average of only 22.5 percent, below even the Western level.

This history also helps account for the prevalence of engineers. They are at the sharp edge of frustrated expectations: engineering is universally one of the most demanding subjects in Muslim-world universities; its tough entry requirements select for talent and ambition. Until the 1970s, engineers constituted a small and typically affluent technocratic elite that had little time for oppositional politics. (Instead, in those days, Islamist groups were dominated by teachers and lawyers.) It is only in the age of mass higher education and economic slowdown, when good employment for engineers starts drying up, that they suddenly show up in radical groups.

The one Muslim country in which few engineers show up among radical ranks is Saudi Arabia. And that is the exception that proves the rule. Different from graduates in social sciences or Islamic studies, Saudi engineers retain excellent labor market chances thanks to the country’s large hydrocarbon and heavy industry sectors.

Cairo University students shout slogans against the government and flash the "V" and Rabaa signs after the verdict of former Egyptian President Hosni Mubarak's trial, at the university's campus in Giza, on the outskirts of Cairo November 30, 2014. Amr Abdallah Dalsh / Reuters BAD GRADS

The conclusion of Engineers of Jihad is rooted in social and economic contexts, but it is different from the much-touted “poverty breeds terrorism” story, which has been convincingly criticized by the scholars Alberto Abadie, Alan Krueger, and James Piazza, among others. Radicalization is not attributed to absolute levels of underdevelopment; rather, it is related to relative deprivation: the frustrated expectations of would-be elites who struggle to find their place in corrupt and stagnant systems. One policy implication is that the overproduction of graduates in countries whose labor markets cannot absorb them is a recipe for instability.

To be sure, relative deprivation does not fully account for the engineers puzzle. After all, engineers still remain overrepresented among the (much smaller) set of Western-based graduate radicals. And here, the influence of some innate preferences and personality traits plays a role. New data on the education of the members of many right- and left-wing militant groups in Europe, the United States, Russia, and the Middle East yield tidy and surprising results: whereas engineers have a strong presence on the radical right, they are nearly absent on the radical left, where humanities and social science students are overrepresented. Different ideologies seem to satisfy the emotional and cognitive needs of different types of individuals.

In the Muslim world, however, development crises since the 1970s are central to the emergence of Islamist radicalism. Even in the age of the Islamic State (also known as ISIS), in which mobilization is apparently no longer limited to frustrated graduates, available data show a continuing overrepresentation of engineers. Taking care of Muslim societies’ young elites would prevent the better-educated individuals from falling into the wrong crowds.