IN HIS CAIRO office overlooking the Nile, a businessman keeps his mobile phone in a glass jar on his desk. Elsewhere in the city a writer keeps hers in the fridge. If smartphones were once the tools of young revolutionaries across the Arab world, the fear is that they have become the means for the mukhabarat, the secret police, to eavesdrop on dissenters by hacking into their telephones and turning them into bugging devices. These days a journalist working across the Arab world needs a phone packed with the latest encrypted communications apps. Egyptians like Signal; Saudis prefer Telegram; the Lebanese are content with the more common WhatsApp.

The deep state in Egypt was dislocated only slightly by the uprising that swept away Hosni Mubarak in 2011. Now it is back with a vengeance, the army having toppled the elected Islamist president, Muhammad Morsi. Under Abdel-Fattah al-Sisi, the general who claims to be a son of the revolution, Egypt is more repressive than it had been under Mr Mubarak, and the economy is doing considerably worse. Protests are growing, particularly over Mr Sisi’s deal with King Salman of Saudi Arabia (both pictured) to hand over two islands in the Red Sea.

Many draw parallels with the repression during Gamal Abdel Nasser’s military rule, minus his heady rhetoric of Arab nationalism. Nasser, too, tried to crush the Muslim Brotherhood. And as with Nasser, there is a danger that Mr Sisi will turn political Islamists into violent jihadists. Islamic State (IS) has declared the Sinai peninsula, once a winter-holiday playground, one of its “provinces”. In October 2015 it brought down a Russian airliner that had taken off from Sharm-el-Sheikh.

Strikingly, all the Arab leaders who were overthrown in 2011 were heading republics, not monarchies. Arab presidents, it seems, are hard but brittle. Nasser’s Egypt was typical of what Jean-Pierre Filiu, a former French diplomat, calls the “Mamluk state”, after the self-perpetuating caste of slave-soldiers who ruled Egypt from the 13th to the 16th century. Mr Filiu applies the label to several other republics—among them Algeria, Syria and Yemen—with a long and mournful history of military domination of the state.

These “Mamluk” republics, mostly socialist-leaning with a penchant for central control of the economy, at first modelled themselves on the authoritarian nationalism of Turkey under Ataturk, though they did not fully share his militant secularism. Their internal-security systems, though, were more akin to those of the Soviet Union, with which they often aligned.

Radical nationalism also served to hide the sometimes narrow sectarian support base of the regimes: the minority Sunnis in Iraq and the Alawites in Syria. It is perhaps no surprise, then, that their regimes were among the most vile. Iraq was called the “Republic of Fear” by a dissident writer, Kanan Makiya; Syria was labelled “The State of Barbarity” by the late Michel Seurat, a French Arabist. Under Saddam Hussein, Iraq gassed the rebellious Kurds at Halabja in 1988; under Hafez al-Assad, Syria flattened the city of Hama in 1982 to crush an uprising by the Muslim Brotherhood. Algeria waged a dirty and bloody war against jihadists that started in 1992 and lasted a decade.

Fear and loathing

Under Mr Mubarak, Egypt was ruled with a lighter touch, perhaps because he was keen to maintain the support of his Western allies. Mr Sisi has had fewer scruples about shedding blood. Thousands have been killed in his suppression of the Muslim Brotherhood, and tens of thousands have been jailed.

According to one conspiracy theory, the Egyptian uprising of 2011 was manipulated throughout by the generals. They used the protesters to get rid of Hosni Mubarak, then the Muslim Brotherhood to sideline liberals, and finally exploited liberal protesters to get rid of the Brothers and introduce direct military rule. In reality their response seems to have been much more improvised, but the theory shows how the deep state is perceived.

And indeed the repression is both arbitrary and vicious. The courts are a law unto themselves. Mr Sisi’s quest for international respectability has not been helped by the torture and murder in February of an Italian PhD student conducting research on Egyptian trade unions, thought to have been committed by members of the secret police.

“I do not think there is a state in Egypt today,” says Yezid Sayigh of the Carnegie Middle East Centre, a think-tank in Beirut. “There is a coalition of interest groups and institutions, each of which is above the state. They are working at cross-purposes and often undermining Sisi.”

The legitimacy of many republics has rested on two objectives: Arab unity and the liberation of Palestine. Neither has been achieved. And for all their republicanism, their rulers often succumbed to the temptation of establishing their own dynasties. In Syria, Hafez al-Assad was succeeded by his son, Bashar. Egypt’s Hosni Mubarak wanted to install his son, Gamal. In Yemen, Ali Abdullah Saleh was thought to be grooming his son, Ahmad. In Tunisia, the ousted president, Zine el-Abidine Ben Ali, was reckoned to be rooting for his son-in-law, Sakher El Materi.

Some mock these states as jumlikiyat, an Arabic neologism combining jumhuriyat (republics) and malakiyat (monarchies). “It reached the absurd point that the state became like a car or apartment that they could give to their kids,” says Ghassan Salamé, professor emeritus at Sciences Po, a university in Paris. “This was a big trigger for the uprisings.”

The genuine Arab dynasties have fared much better, at least so far. In the days of nationalist tumult they seemed an endangered species: five Arab monarchs were toppled, from King Farouk of Egypt in 1952 to King Idris of Libya in 1969, and the rest felt threatened for decades. But now there seems to be something in the nature of Arab monarchy—maliks, emirs and sultans—that is more resilient than presidential autocracy.

Mr Salamé sees three main sources of legitimacy for Arab rulers: representation (none is freely elected), achievements (most republics have few to boast about) and provenance (currently the best qualification). “I rule you because I created you,” as Mr Salamé puts it. That is certainly true of the Saudi royal family, which, uniquely, has given its name to its country and can trace its rule in the central Nejd region back to the 18th century.

For the six oil-producing states of the Gulf Co-operation Council (GCC)—Saudi Arabia, Kuwait, Bahrain, Qatar, the United Arab Emirates and Oman—the key to survival has been money. Throughout the turbulence of the Arab spring the monarchies were splurging out, raising salaries and launching new projects to maintain popular support.

Moreover, all GCC states enjoy unspoken diplomatic and military support from outside as allies of the West (Qatar has a large American air base and Bahrain a naval one). After widespread protests in Bahrain, where a minority Sunni family rules a mostly Shia population, other Gulf states sent forces to the island to help shore up the monarchy.

Morocco and Jordan do not produce oil, but their kings, Mohammed VI and Abdullah II, derive some authority from religion, pointing to their descent from the Prophet Muhammad. They also claim political legitimacy: Morocco’s former sultan, Mohammed V, was exiled to Madagascar by the French, and the demand for his return became the rallying cry for Moroccan nationalists. The Hashemites, for their part, raised the flag of revolt against Turkish rule (with British help) in 1916.

Perhaps more important than heritage, though, has been the ability of both monarchies to adapt to changing times. Unlike the ruling families of the Gulf, where royals hold posts throughout the government bureaucracy, those of Morocco and Jordan tend to stand more aloof from day-to-day government. They have also shown a knack for co-opting some critics, or at least maintaining dialogue with them. During the Arab spring both made a show of responding to demands for greater freedom. Both countries introduced limited constitutional reforms and held parliamentary elections. Jordan is more tense. The Muslim Brotherhood boycotted the ballot, and the government is trying to split the movement. In Morocco, the Brotherhood-inspired Justice and Development for the first time won the largest number of votes of any party. Its leader, Abdelilah Benkirane, became prime minister at the head of a four-party coalition.

Arab history since the emergence of Islam in the 7th century is dominated by three empires: Umayyad, Abbasid and Ottoman. “The idea of dynasties is in the mindset of the people. If you held a referendum in Jordan, a vast majority would vote for the monarchy,” says Oraib Rantawi, director of the Al-Quds Centre for Political Studies, a think-tank in Jordan. Political parties in Jordan and Morocco have mostly agreed to abide by the rules, above all acceptance of the monarchy. Elsewhere, says Mr Rantawi, “bloody regimes create bloody oppositions.”