MANY Brexiteers built their campaign on optimism. Outside the European Union, Britain would be free to open up to the world. But what secured their victory was anger.

Anger stirred up a winning turnout in the depressed, down-at-heel cities of England (see article). Anger at immigration, globalisation, social liberalism and even feminism, polling shows, translated into a vote to reject the EU. As if victory were a licence to spread hatred, anger has since lashed Britain’s streets with an outburst of racist abuse.

Across Western democracies, from the America of Donald Trump to the France of Marine Le Pen, large numbers of people are enraged. If they cannot find a voice within the mainstream, they will make themselves heard from without. Unless they believe that the global order works to their benefit, Brexit risks becoming just the start of an unravelling of globalisation and the prosperity it has created.

The rest of history

Today’s crisis in liberalism—in the free-market, British sense—was born in 1989, out of the ashes of the Soviet Union. At the time the thinker Francis Fukuyama declared “the end of history”, the moment when no ideology was left to challenge democracy, markets and global co-operation as a way of organising society. It was liberalism’s greatest triumph, but it also engendered a narrow, technocratic politics obsessed by process. In the ensuing quarter-century the majority has prospered, but plenty of voters feel as if they have been left behind.

Their anger is justified. Proponents of globalisation, including this newspaper, must acknowledge that technocrats have made mistakes and ordinary people paid the price. The move to a flawed European currency, a technocratic scheme par excellence, led to stagnation and unemployment and is driving Europe apart. Elaborate financial instruments bamboozled regulators, crashed the world economy and ended up with taxpayer-funded bail-outs of banks, and later on, budget cuts.

Even when globalisation has been hugely beneficial, policymakers have not done enough to help the losers. Trade with China has lifted hundreds of millions of people out of poverty and brought immense gains for Western consumers. But many factory workers who have lost their jobs have been unable to find a decently paid replacement.

Rather than spread the benefits of globalisation, politicians have focused elsewhere. The left moved on to arguments about culture—race, greenery, human rights and sexual politics. The right preached meritocratic self-advancement, but failed to win everyone the chance to partake in it. Proud industrial communities that look to family and nation suffered alienation and decay. Mendacious campaigning mirrored by partisan media amplified the sense of betrayal.

Less obviously, the intellectual underpinnings of liberalism have been neglected. When Mr Trump called for protectionism this week, urging Americans to “take back control” (see article), he was both parroting the Brexiteers and exploiting how almost no politician has been willing to make the full-throated case for trade liberalisation as a boost to prosperity rather than a cost or a concession. Liberalism depends on a belief in progress but, for many voters, progress is what happens to other people. While American GDP per person grew by 14% in 2001-15, median wages grew by only 2%. Liberals believe in the benefits of pooling sovereignty for the common good. But, as Brexit shows, when people feel they do not control their lives or share in the fruits of globalisation, they strike out. The distant, baffling, overbearing EU makes an irresistible target.

Back to the future

Now that history has stormed back with a vengeance, liberalism needs to fight its ground all over again. Part of the task is to find the language to make a principled, enlightened case and to take on people like Ms Le Pen and Mr Trump. The flow of goods, ideas, capital and people is essential for prosperity. The power of a hectoring, bullying, discriminatory state is a threat to human happiness. The virtues of tolerance and compromise are conditions for people to realise their full potential.

Just as important is the need for policies to ensure the diffusion of prosperity. The argument for helping those mired in deprivation is strong. But a culture of compensation turns angry people into resentful objects of state charity. Hence, liberals also need to restore social mobility and ensure that economic growth translates into rising wages. That means a relentless focus on dismantling privilege by battling special interests, exposing incumbent companies to competition and breaking down restrictive practices. Most of all, the West needs an education system that works for everyone, of whatever social background and whatever age.

The fight for liberalism is at its most fraught with immigration. Given that most governments manage who comes to work and live in their country, the EU’s total freedom of movement is an anomaly. Just as global trade rules allow countries to counter surges of goods, so there is a case for rules to cope with surges in people. But it would be illiberal and self-defeating to give in to the idea that immigration is merely something to tolerate. Sooner than curb numbers, governments should first invest in schools, hospitals and housing. In Britain new migrants from the EU contribute more to the exchequer than they take out. Without them, industries such as care homes and the building trade would be short of labour. Without their ideas and their energy, Britain would be much the poorer.

Liberalism has been challenged before. At the end of the 19th century, liberals embraced a broader role for the state, realising that political and economic freedoms are diminished if basic human needs are unmet. In the 1970s liberals concluded that the embrace of the state had become smothering and oppressive. That rekindled an interest in markets.

When Margaret Thatcher was prime minister, amid the triumph of Soviet collapse, an aide slipped Mr Fukuyama’s essay on history into her papers. The next morning she declared herself unimpressed. Never take history for granted, she said. Never let up. For liberals today that must be the rallying cry.