In his final address to the United Nations, United States president Barack Obama warned the assembled leaders that the liberal world order was under threat from what he called “crude populism”. In words which could apply equally to Donald Trump, the Republican candidate to succeed him as president, and Russia’s Vladimir Putin, Mr Obama said that some were arguing that the future favours the strong man. “History shows that strong men are then left with two paths: permanent crackdown, which sparks strife at home, or scapegoating enemies abroad, which can lead to war.”

In some ways Mr Obama is ending his two terms in the White House in the same way he began. He set out to open a new page in the Middle East, reversing the Bush era’s imperial expansion, and with a view to make peace with Iran and reset relations with Russia. So joyous was the mood in Europe at that time that the president was awarded the Nobel Peace Prize on the basis of his fine words.

He would be shocked to learn that the legacy of his administration may turn out to be something quite other than what he set out to do – the rise of populism around the world.

The high point of globalisation has come and gone. Now voters all over the democratic world are more concerned by things they have lost – independent national decision-making, for example – than the benefits cited by economists and other experts of free trade and movement of people. The free trade deals with Europe and the Pacific nations championed by the Obama administration now seem a lost cause.

These tectonic shifts are clearly seen in the British vote on June to leave the European Union, a decision which is bound – in the words of financial commentator Martin Wolf – to make the country “meaner and poorer”. And in the rise of Mr Trump, whose victory in the presidential election in November is now a real possibility, although it still will be harder for him than for Hillary Clinton.

Mr Trump’s ascendance raises questions about what populism is. All politicians seek the popular vote, so what is new? And in US presidential elections it is traditional for every candidate to promise to ride into Washington like a western gunslinger and clean up the mess. This is one of the weaknesses of Mrs Clinton’s campaign: in no way can she claim to be an outsider. Her establishment credentials are painfully apparent when the super-rich gather for meetings of the Clinton Global Initiative, her family’s charitable foundation.

In a forthcoming book, What Is Populism?, politics professor Jan-Werner Muller argues that not all attackers of the status quo are populists. Real populists are the likes of Mr Trump, Turkish president Recep Tayyip Erdogan and the British Eurosceptic Nigel Farage who claim that they, and only they, represent the people. They tend to talk in terms of “my people” or “real people” while their opponents are dupes or traitors, and the country is better off without them, as shown by the thousands of educated people leaving Russia unmourned by Mr Putin.

Being convinced of their rightness, real populists cannot accept defeat in elections – it must be due to fraud or conspiracy, a topic often raised by Mr Trump when he has appeared to be in danger of losing. In the case of Mr Erdogan, his mindset has been reinforced by the reality of the military coup that failed to topple him.

“Populists are just different elites who try to grab power with the help of a collective fantasy of political purity,” Muller has written.

This is not to say their arguments are without merit. The American political landscape is manipulated by huge corporations and wealthy individuals with vast lobbying power. Mrs Clinton’s candidacy looks like a case of the elite within the Democratic Party deciding it was “Hillary’s turn”, an assessment confirmed by hacked emails which proved that the supposedly neutral Democratic National Convention favoured her over her rival, Bernie Sanders.

There is no doubt that wealth is concentrated in ever fewer hands, while the titans of Silicon Valley disrupt the old economy and the jobs it provided until they create their own cosy oligopoly which is proof against disruption.

All these are valid criticisms which have been picked up by Mr Trump and turned into a combustible mixture with the addition of his trademark lies, boasts and racist and misogynistic provocations.

No one knows if Mr Trump can with the presidency – it is a distinct possibility – but it is clear that the Trump insurgency will leave its mark on politics in the US and around the world even if he loses. As the economy becomes more globalised, politics is becoming more local, a process hastened by the rise of social media and the decline of the old media gatekeepers in newspapers and television.

Mr Trump has brought nation, race and religion to the forefront of politics and this will have to be acknowledged by future Republican candidates. All this is a long way from the “post-racial America” predicted after Mr Obama’s election. The president might ruefully conclude that America was not ready for a black man in the White House. Perhaps it is not ready for a woman, either.

Abroad, the “strong men” denounced by Mr Obama are not doing too badly. Mr Putin has perfected what the Russians call the “political technologies” to stay in power and manage the challenges of low oil price sand sanctions far better than predicted. Hungary, where prime minister Victor Orban’s “Christian-national” state is denounced in Brussels as a violation of European values, is the darling of the bond dealers.

Populism stole up on the world during Obama’s presidency. It is not what he wanted, and he cannot be held responsible for the result of global forces beyond his control, but that may be the legacy of his time in office.

Alan Philps is a commentator on global affairs

On Twitter: @aphilps