In the past two years Saudi Arabia has suffered a series of brutal terrorist attacks, most recently the beheading of an American. Growing alarm about the country’s stability is driving up oil prices. Is Saudi Arabia coming undone?

“Saudi Arabia’s thirst for bootleg liquor has been linked to a spate of bombings that has left one expatriate Briton dead and four others injured in the past month…” – from the Australian, December 2000.

In the year 2000 such stories began to slip from behind the Saudi veil. An unlikely mix of foreign nationals – Canadians, Belgians, Britons – not know for gangsterism were turning Riyadh into a reenactment of Prohibition-era Chicago. Behind the walls of the immense compounds favored by the Saudi elite was there a secret world of speakeasies, gangster molls and tommy guns?

In fact, no. There was a secret, to be sure. But the secret was not moonshine stills, it was al-Qaeda, which by then had begun killing foreigners working in the kingdom. The alcohol smuggling stories were, it seems, an elaborate hoax by the Saudi authorities to cover up their growing problems with Islamic terrorism.

It is an odd story, and also an important one. In Saudi Arabia, political instability is not necessarily what it seems.

To understand why the Saudis would invent tales of gang warfare and distribute them to the world’s press – including some “confessions” by British and Canadian gangsters allegedly produced under torture – one needs to know the rules of Saudi politics.

This is a land of long and proud tradition, though a country of recent vintage. The story of Saudi Arabia’s founding – perhaps embellished over the years – is suitably fierce. Muhammad Ibn Saud, ruler of a small settlement in a vast desert, formed, in 1745, an alliance with Muhammad Ibn Abd al-Wahhab, a proselytizing holy man touting a return to a stricter brand of Islam.

One of history’s great pairings. Ibn Saud provided the tactics and organization. Al-Wahhab provided a steady stream of converts who became holy warriors in Ibn Saud’s army. This combination of politics and religion proved unstoppable. Over the decades the house of Saud spread its rule from a single desert oasis to much of the Arabian peninsula.

According to scholar Joshua Teitelbaum, to this day this story provides the justification for the Saudi princes’ continued rule. The government is, officially, an alliance between the umara – princes – of the Saud family and the ulama – religious scholars – of Wahhabi Islam.

Thus the rules of Saudi politics. To execute its holy duty, the government must defend and promote Wahhabi Islam. It must “protect the principles of Islam, enforce its shariah [religious law], ordain what is good, and forbid what is evil.” This does not necessarily mean democracy. It does, however, mean printing and distributing holy texts, funding mosques, religious schools, and even stick-wielding religious police, and overseeing the annual pilgrimage to Mecca.

This is a powerful source of legitimacy, steeped in faith and history. But it is always vulnerable to the critique that someone else can do a better job defending Islam than the princes can.

In the 1970s, that someone else was the theocracy in Iran. The Ayatollah Khomeini, taking power in Iran via an Islamic revolution, issued a famous challenge to the Saudi ruler – “there is no king in Islam.” Inspired by this call, and repulsed by the modernity that oil wealth was bringing to Arabia, Saudi militants seized control of the Grand Mosque in Mecca and demanded the Saudi king resign.

In response the Saudi government cracked down on dissenters. But it also made dramatic efforts to better fulfill its religious mandate. The princes channeled the country’s oil wealth into a great attempt to expand Wahabbist doctrine abroad, via the funding of foreign mosques, Islamic rebel movements, and Islamic charities. The oil would continue to be sold to the infidels – but the proceeds would go to the defense of Islam.

Today’s threat to the princes is no longer Iran. It is al-Qaeda – the remnants of the Arab Afghans, one of the foreign rebellions at one time funded by the Saudi government. The princes have no love for al-Qaeda, but they must always be mindful of the rules of Saudi politics.

It is counterintuitive but true that a sitting government’s first priority is not always political stability. President Robert Mugabe in Zimbabwe has encouraged violent takeovers of white-owned farms as a way to rally political support. China’s Chairman Mao encouraged bloody political purges; Ferdinand Marcos faked a series of terror attacks as an excuse to declare martial law.

The terrorist attacks in Saudi Arabia are not faked. Al-Qaeda is a real threat to the Saudi regime. On the other hand, stopping the attacks – especially those that target foreigners – is not the government’s first priority. Wahhabis have always separated themselves from non-Muslims, and some radicals oppose any contact at all with Christians and Jews. Hence when terrorists target foreigners who have come to Saudi Arabia, some Saudis – including some in the police and army – see this as a success, and no threat to the Saudi regime.

It is hard for the princes to launch an all-out crackdown – for instance, policing donations to Islamic charities and limiting extremist rhetoric on state-funded broadcasts – because these are part and parcel of the government’s religious mission. Further, it is hard to crack down on any group that the Saudi public believes to be defending the principles of Islam – as al-Qaeda claims to do.

Repeated terrorist attacks are often a sign of a weak government or rising public anger. But in Saudi Arabia, the situation is more complicated. To be sure, in the wake of terrorist attacks on Saudi government targets in 2003 – no longer just foreign workers – the princes have launched a more genuine crackdown.

But given the country’s history, it is no surprise that the terrorist attacks should continue. Decades of an ambiguous response – and funding of extremist causes and messages – have made terrorist attacks, especially those that target foreigners, a Saudi curse. In Saudi Arabia, political instability is not always what it seems.

This article was originally published on Countryrisk.com, before I sold the website to Roubini Global Economics.