Turkey has a proud and rich history of military coups. As analysts tirelessly point out, they are even sanctioned by the Constitution as a means of preserving secularism.

However, those days have come to an end.

The abortive coup of the past few days was in all likelihood the dying gasp of 20th century Turkey.

I

In Western op-eds over the years, there has been rising disquiet over the AKP’s “Islamization” of Turkish society, including the education system. However, if opinion polls are anything to go by, the Islamization effect has been slight.

According to the World Values Survey, a comprehensive survey of global cultural values that runs in multiyear “waves,” there has been no very significant rise in religious fervor in Turkish society from the first wave in 1989-1993 to the last wave in 2010-2014. A mere 1% of Turks disbelieve in God, but that is barely different from 2% in the mid-1990s (and exactly analogous to the US in the early 1980s and Poland in the early 1990s). The percentage of Turks who listed “religious faith” as one of the more desirable traits for their children fell from 44% to 40% in the last 25 years, and while the percentage of Turks who consider religious faith to be “very important” rose from 60% in the early 1990s to around 80% through the rest of the 1990s and 2000s, in the very last wave of surveys that number fell back to 68%. The percentage of Turks considering themselves to be a “religious person” rose from 73% in the early 1990s, but has remained stable at around 80%-85% ever since. And despite all the mosque building under the AKP, religious attendance has virtually no changes over the past quarter century and only 1% of Turks say they are members of a religious organization.

The banal reality is that Turkey has consistently been a conservative and strongly religious society (even if it is nothing on the scale of Arab countries where half or more of the population supports the death penalty for adultery and apostasy). Some 70% of Turks agree that in conflicts between religious and science, the former is “always” right. This is lower than the 90%+ agreement rate you see in Arab Muslim countries for this question, but is considerably higher than in the more religious Western countries such as the US (39%) and Poland (25%) – or for that matter in Russia (22%), for all the rhetoric about it becoming a theocracy.

On the other hand, a generation ago, masses of bearded men would not have come out onto the streets of Istanbul, charging rifle tanks and putting themselves in the way of tanks, to defend an Islamist President against a military coup. They would not have then proceeded to beat up and in some cases lynch surrending soldiers, most of whom – as it now emerges – were hapless conscripts who were not even aware that they were participating in a coup.

But if this wasn’t a case of the AKP’s Islamization campaign generating many more hardcore Islamists, what actually changed?

II

The answer ultimately lies in Turkish demographics: In short, the devout Muslims have migrated to the cities.

In the past generation, Turkey has urbanized at breakneck speeds. The urban population share of Turkey has increased from 44% in 1980, the data of the last major successful coup, to 73% today. In absolute numbers, this translated in an increase from 20 million to 55 million urban denizens during this period, including a fivefold increase in Istanbul from 3 million to 15 million. The other western coastal cities and Ankara also saw major increases.

From 1965 to today, the share of the Turkish population residing in richer, more heavily urbanized Western Turkey soared from a third to a half, while poorer and more rural Central Turkey and Eastern Turkey fell from a third each to 23% and 28%, respectively. However, Western Turkey also has the country’s lowest fertility rates, at less than the replacement level rate of 2.1 and comparable to those seen in the North-Eastern USA.

Total fertility rates in Turkey in 2000.

So where did their new denizens come from?

Internal migration in Turkey.

They came from the Anatolian hinterlands, whose fertility rates – almost one expected child more in Marmara and the Aegean coast – are comparable to that of Utah, not New England. They are much more conservative, much more religious, and less socioeconomically advanced (Western coastal Turkey has a GDP per capita comparable to Greece, whereas Central Turkey is more comparable to Romania and the Kurdish triangle to the southest converges to more overtly Third World conditions).

These people of Middle Turkey, derided as backwards country bumpkins and Islamist retrogrades by coastal Kemalist latte-sipping urbanites, have their own political vision…

Typical Turkish electoral map (2011 elections).

… which is centered on the social conservatism and political “Islamism Lite” of Erdogan and the AKP. And they continue to have many more babies than the traditional westcoasters, even after moving there: Whereas in 2003 the TFR of urban natives across all of Turkey was a mere 1.68 children per woman, considerably lower than the all Turkish average of 2.23 children per woman, for rural-to-urban migrants it was 2.82 children per women, and only modestly lower than the 3.28 rate for rural natives.

Incidentally, this also explains the strong Islamism, low socioeconomic status, high fertility rates (higher than back home!), and high degree of Erdogan support amongst German Turks. The Gastarbeiters primarily hailed from Middle Turkey, and the migration to Germany was just one aspect of the mass population movement from there to more advanced areas in the second part of the 20th century.

III

And all this, possibly more so than contingent factors like poor planning or the failure to eliminate Erdogan, explains why the military coup failed.

First off, this internal migration of virile Islamists created a class of urbanites in Ankara and especially Istanbul who were ready to go out for and in some cases to lay their lives down for their beliefs. While historically rapid urbanization was associated with political instability and revolution, the major difference is that in Turkey, it is Erdogan who is the candidate of the sans-culottes and of the factory workers. In previous coups, the military could take control to reinstate secularism at will, and what was an aggrieved Muslim in the Anatolian boondocks to do about it? Stew in his own juices. But now, those same people could flood into the streets, having been rapidly mobilized by their neighborhood imams and Erdogan pleading for help on social media.

Second, it should be noted that the economic effects of Anatolian urbanization have worked strongly to the Islamists’ favor. Apart from the direct benefits to people’s pockets that came with the fusion of political Islam and economic liberalization, the construction projects associated with the mass Anatolian relocation to Ionia and Marmara, as well as the industries that sprang up to service their needs (retail, credit, etc.), has created a class of Turkish oligarchs. Moreover, unlike in say Russia, where the oil & gas oligarch class remains somewhat resentful of Putin for circumscribing their power after the 1990s free-for-all when not expropriating their ill-gotten gains outright, the Turkish oligarchs created in the 1990s generally have more reasons to remain loyal to the regime:

The names of those allegedly involved reads like a Who’s Who of Turkey’s ­government-linked oligarchy, whose firms have profited in recent years from the more than $100bn-worth of public contracts awarded by the AKP. Nepotism in the awarding of tenders has long been one of the most visible signs of corruption in Turkey, and in the AKP’s years a coterie of construction firms has risen up around it.

A hostile oligarch class combined with an independent military makes for a highly unstable polity and has been the traditional bane of populist governments in Latin America. Erdogan, however, has successfully coopted the oligarch class through the same mechanisms that won him the support of a critical mass of people in Turkey’s twin capitals.

IV

It is now increasingly evident that a political transformation of cardinal proportions is taking place in Turkey. As of the time of writing, around 30 governors, 100 generals, 2,700 judges, 3,000 soldiers, and 8,000 police have been dismissed or arrested – in short, something like a third of Turkey’s high-level apparat has been purged. Although there remain good grounds to continue to doubt that the coup was “planned” by Erdogan, it’s pretty clear that the Black Book was written long beforehand for just such an occasion.

If Erdogan now uses the opportunity to take Turkey in a much more Islamist direction what do the demographic trends indicate about his chances of longterm success?

First off, it was not that the incidence of religiosity has increased in Turkey. In fact, DESPITE the much higher fertility rates of the Islamists, and more than a decade’s worth of active Islamization, religiosity in Turkey has only modestly increased during the 2000s and actually seems to have started falling again by the time of the fifth WVS (see above). This is quite stunning in that it implies that the global secular trend towards secularism (LOL) is incredibly strong, in that even in Turkey it has succeeded in holding its own against very powerful demographic and propaganda countercurrents. Even if Turkey went so far as to delink itself from the Council of Europe and NATO, it’s not clear why these secularizing forces should stop acting on it.

Second, there is the Kurdish factor. Although the oft made case for similarities between Putin and Erdogan have tended to be overstated, there is one sphere in which I think where the comparison is legitimate: Ethnic policy. Both are “manynationals” who are using ideology to try to glue their country together – Islam is basically the Turkish version of Russia’s WW2 Victory cult with a small dose of “spiritual buckles” like the anti-LGBT law. But if anything Turkey’s problems are more acute. Russia’s only truly “problematic” region in that it combines an aggrieved ethnicity with a high total fertility rate – which at 2.9 children per woman is not even that high – is Chechnya, which only has 1% of Russia’s population. In contrast, Kurdish Turkestan has more than 10% of the Turkish population and almost all of its provinces have a fertility rate of greater than 3 children per woman. Will an even more rigorous Islamization campaign keep them within Turkey or will the gravitational attraction of the incipient Rojava state prove to be unavoidable?

On that particular front, there are few grounds for optimism. It is above all Erdogan’s own foreign policy that enabled the rise of Rojava and it is too late to put the lid on it; certainly it is beyond the capabilities of the SAA itself, which has enough problems dealing with Al Nusra and Islamic State to say nothing of an SDF that is now supported by US airpower. And Turkey’s own military capabilities have, at least in the short-term, been sharply curtailed by Erdogan own purge of as many high-ranking officers (percentage wise) within a couple of days as Stalin only managed to do over the course of a year.