IS DEMOCRACY in trouble? Nearly 30 years after Francis Fukuyama declared the end of history and the triumph of liberal democracy, this question is no longer outlandish. America, long a beacon of democracy, has a president who tramples on its norms. Xi Jinping is steering authoritarian China towards one-man rule. And across the emerging world, strongmen stride tall. Turkey’s president, Recep Tayyip Erdogan, having locked up or purged more than 200,000 Turks for political reasons, will probably prevail in elections that start on June 24th and assume sultan-like powers. Nicaragua’s regime is pulling out protesters’ toenails. Vladimir Putin is about to reap a huge propaganda coup from the World Cup.

Indices of the health of democracy show alarming deterioration since the financial crisis of 2007-08. One published by The Economist Intelligence Unit, our sister firm, has 89 countries regressing in 2017, compared with only 27 improving. Some surveys find that less than a third of young Americans think it is “essential” to live in a democracy. Small wonder that this year has seen a boom in books with frightening titles such as “How Democracy Ends” and “The People vs. Democracy”.

This pessimism should be put in context. It is a recent reversal after remarkable progress in the second half of the 20th century. In 1941 there were only a dozen democracies; by 2000 only eight countries had never held an election. A broad poll of 38 countries shows that typically four out of five people prefer to live in a democracy. And not all threats to pluralism are of the same order. In mature democracies such as America, strong checks and balances constrain even the most power-hungry president. In immature democracies, such institutions are weaker, so a strongman can undermine them quickly, often without much fuss. That is why the most worrying deterioration, going by both the number of countries and the speed of retreat, is in the fragile, young democracies of the emerging world. From Venezuela to Hungary, these reversals reveal striking similarities (see International section). That suggests reasons for optimism—as well as lessons for the West.

How to undermine a democracy

Put crudely, newish democracies are typically dismantled in four stages. First comes a genuine popular grievance with the status quo and, often, with the liberal elites who are in charge. Hungarians were buffeted by the financial crisis and then terrified by hordes of Syrian refugees passing through en route to Germany. Turkey’s pious Muslim majority felt sidelined by secular elites. Second, would-be strongmen identify enemies for angry voters to blame. Mr Putin talks of a Western conspiracy to humiliate Russia. President Nicolás Maduro blames America for Venezuela’s troubles; Hungary’s prime minister, Viktor Orban, blames George Soros for his country’s. Third, having won power by exploiting fear or discontent, strongmen chisel away at a free press, an impartial justice system and other institutions that form the “liberal” part of liberal democracy—all in the name of thwarting the enemies of the people. They accuse honest judges of malfeasance and replace them with stooges, or unleash tax inspectors on independent television stations and force their owners to sell.

This is the stage of “illiberal democracy”, where individual rights and the rule of law are undermined, but strongmen can still pretend to be democrats since they win free-ish elections. Eventually, in stage four, the erosion of liberal institutions leads to the death of democracy in all but name. Neutral election monitors are muzzled; opposition candidates locked up; districts gerrymandered; constitutions altered; and, in extreme cases, legislatures emasculated.

The battle is not always to the strongman

This process is neither inevitable nor incurable. India has had a vibrant democracy for 70 years; Botswana for more than 50. Deteriorations can be stopped and even reversed. In recent weeks Malaysians voted out Najib Razak and the UMNO party that had ruled since independence; protesters in Armenia broke a decade of one-party rule. Last December South Africans forced out President Jacob Zuma, a would-be strongman who let his cronies loot the state. Even Turkey is not doomed: opposition parties have a good chance of winning control of parliament this month.

It is hard to say which democracies are at risk. Economic stagnation and surges in immigration are often precursors of trouble. But they are neither necessary nor sufficient. Few would have predicted that democracy would totter in Poland, a booming economy with few immigrants that has benefited hugely from European Union membership. More important than the underlying conditions is the degree to which would-be autocrats learn from each other—how to spread fake news, squash pesky journalists and play the populist card. Their weaknesses are remarkably similar, too. From Malaysia to South Africa, strongmen have eventually been felled by popular revulsion at the scale of their corruption.

These similarities hold some lessons. The main one is that institutions matter. Western democracy-promotion has often focused on the quality of elections. In fact, independent judges and noisy journalists are democracy’s first line of defence. Donors and NGOs should redouble their efforts to support the rule of law and a free press, though autocrats will inevitably accuse those whom they help of being foreign agents. The second is that the reversals have been driven by opportunistic strongmen rather than the voters’ embrace of illiberal ideology. That ultimately makes these regimes brittle. When autocrats steal too brazenly, no censor can stop people from knowing—and sometimes booting them out. The last, more uncomfortable lesson is that the example set by mature democracies matters. America’s powerful institutions will constrain President Donald Trump at home. But they do not stop his contempt for democratic norms—the serial lying, the cosying with dictators—from giving cover to would-be autocrats.

Reports of the death of democracy are greatly exaggerated. But the least-bad system of government ever devised is in trouble. It needs defenders.