Over the past 30 years China has become the world’s factory. For the past few weeks, the production line has been shut down by plant closures deemed necessary to halt the spread of coronavirus. Beijing fears there will be both short- and long-term damage from the outbreak. The country is on course for its first quarter of negative growth in decades, while earlier this week China’s ambassador to the World Trade Organization (WTO) called on other countries not to use coronavirus as an excuse to put up trade barriers.

The fact that Zhang Xiangchen felt the need to make this appeal speaks volumes. China suspects there will be backdoor protectionism – and it is almost certainly right, because for years countries around the world have needed little encouragement to resort to protectionism. What’s more, the restrictions are not just on the movement of goods. Earlier this month, the US treasury announced curbs on foreign investment to protect critical technology, data and infrastructure from foreign sabotage. Donald Trump’s plans for a wall along the US border with Mexico are emblematic of a toughening up of controls on migration. An era of open markets and open borders – where trade and transnational capital flows rose rapidly as a share of global output – has run its course. The instruments of deglobalisation are being weaponised.

Companies are realising that lengthy global supply chains have costs as well as benefits. Coronavirus has brought that home with a vengeance

Today, governments are less interested in breaking down barriers and more concerned about safeguarding jobs, preventing intellectual property theft and the risk of cybercrime. Companies are realising that lengthy global supply chains designed to take advantage of low wages in the developing world have costs as well as benefits. Coronavirus has brought that home with a vengeance, and is likely to further encourage the repatriation of production that was offshored in the 1990s and 2000s.

Deglobalisation has happened before, notably between 1914 and 1945. It is happening now as a result of geopolitics, economic torpor, rising inequality, the failure to develop new political structures to manage globalisation, and the response to new threats.

Every wave of globalisation has required a champion, a hegemonic power confident enough to spread the gospel of free trade and open markets. That role fell to Britain in the late 19th century and the US in the second half of the 20th century.

But America’s self-confidence has been punctured by the rise of China as a strategic threat, and the power struggle between the world’s two biggest economies is heating up. Stock markets were jubilant when Washington and Beijing signed a trade deal but – rather like the Molotov-Ribbentrop pact of August 1939 – it is merely a truce of convenience. If Trump wins re-election in November, hostilities will resume.

Countries also get defensive when times are tough, as they have been ever since the financial crisis of 2008. The most recent wave of openness occurred in the decade after the collapse of communism, culminating in China becoming a member of the WTO in 2001. This was a time when growth was strong, partly due to a globalisation feedback loop in which cheaper imports pushed down inflation rates and allowed central banks in the west to keep interest rates low and asset prices high.

Facebook Twitter Pinterest ‘Taking back control is proving to be a compelling rallying cry for the populists of the right such as Trump and the populists of the left such as Bernie Sanders.’ Sanders campaigns during the New Hampshire primary. Photograph: Timothy A Clary/AFP/Getty Images

But the financial crisis exposed the weaknesses of a system that was able to operate globally without adequate controls and effective supervision. The resulting slump was deep and the recovery has been long, painful and incomplete. Inevitably, countries have become more cautious.

That trend has been amplified because globalisation’s fruits have been enjoyed primarily – though not exclusively – by owners of capital and the better off. Consumers have gained from lower prices, but inequality has risen in every part of the world. In democracies, there is a limit to how long people will put up with the rich getting richer while their living standards are stagnating or barely growing.

The hope – always somewhat sketchy – was that an international polity would be developed to match the internationalisation of economics. If capital could organise on a global level, the argument went, then democratic mechanisms could and would be developed too. This simply has not happened.

The one multilateral institution created in the past three decades to manage globalisation – the WTO – is in a parlous state. The WTO has two main functions: as a forum where comprehensive trade deals are negotiated, and to provide a court where trade disputes between countries can be settled. It is currently doing neither.

Trump's greatest vulnerability is the economy – just ask poor Americans | Reverend William Barber Read more

The failure to develop a transnational political response to globalisation has meant voters have demanded a response at a level where they have a voice: the nation state. Taking back control is proving to be a compelling rallying cry for the populists of the right such as Trump and the populists of the left such as Bernie Sanders. Neither man has much time for the WTO.

Global heating looks certain to add to the deglobalisation pressure. The existential threat posed by the climate emergency is forcing governments, businesses and consumers to ask some questions about the way the global economy works. Is it sensible to ship car parts backwards and forwards across national borders or invest in fossil fuel companies? Is it sustainable to fly in fruit and veg from the other side of the world rather than grow it locally? Most fundamentally of all, are there more important things than economic growth?

Globalisation was sold as a way of boosting prosperity for all by making markets bigger and more efficient. For a while the model worked, but when it blew up and caused extensive collateral damage, a backlash was inevitable. Deglobalisation is the result.

• Larry Elliott is the Guardian’s economics editor