Donald Trump has been an opponent of free trade deals all his public life. A protectionist message was central to his run for the White House. On the campaign trail he promised “reversing two of the worst legacies of the Clinton years”: railing first against the North American Free Trade Agreement, Nafta, and second against China’s entry into the World Trade Organization. His bluster led to a new trade agreement brokered with Canada and Mexico, although it is unclear whether the changes achieved were little more than cosmetic. Unburdened by modesty or honesty, Mr Trump hailed his “new Nafta” agreement as “truly historic”.

Having decided “trade wars are good, and easy to win”, the US president has for months been on course for a battle with Beijing. The trouble is that China is not a Mexico or a Canada, which appear prepared to feign a defeat for a quiet life with a bigger bully. China is a pugilistic power, led by its most powerful leader in decades, intent on recovering global respect. That might explain why, on the cusp of a deal between Washington and Beijing, China tore up the negotiating text that both countries had been using as a blueprint for a sweeping trade pact. In retaliation, the US imposed higher tariffs on $200bn worth of Chinese goods, sparking fears for a full-blown trade war. Global trade could decline by 2%, with GDP slowing by 0.8%.

Neither nation wants to give way, yet both should consider stepping away from the battlefield, for very different reasons. China views the current global trading arrangements as having aided its economic rise. China’s entry into the WTO was meant to see it become a western-style market economy. It did not. But China rapidly transformed poor farmers into workers in manufacturing operations for export markets, spurring growth and reducing poverty. The resulting decline in global inequality was accompanied by an increase in domestic inequality and sharpening cleavages in wealthier importing nations.

Western consumers got cheaper goods while the bulk of the costs are borne by the Chinese themselves. The inconvenient truth is that trade’s benefits are widely spread, while its losses are concentrated in poorer, less skilled groups. In the west the issue provides a convenient scapegoat, since politicians like Mr Trump can point to foreigners such as the Chinese or Mexicans as the source of the problem.

Globalisation in its current form often fails to address fairness as well as economic efficiency. It’s one thing for jobs to be lost to a rival whose workforce competes under the same rules. It’s another when the competitor takes advantage of lax labour, environmental, tax or safety standards in other countries. Workers losing their jobs as a result of ‘‘unfair’’ practices has become political dynamite. Harvard’s Dani Rodrik pointed out last year that there are strong links between the rise of populist movements and the fallout from globalisation. In Britain it was found that, once education levels had been taken into account, people in regions more affected by the import shock were more likely to have voted leave.

The trade war between the US and China has its roots in a form of globalisation that forces countries to open up their economies to foreign firms with little regard of how to manage the resulting social consequences. If they attempt to do so it is currently seen as a way of impeding market access. What Beijing sees as sensible policies required for social stablility and technological progress, Washington says are “non-tariff” barriers for its firms.

The world’s trading rules need rewriting, not least so that its largest economies can trade peacefully. They need to allow a freer hand for countries to pursue “fairer trade” strategies that suit their economies and societies. In richer nations labour markets ought to able to be protected from social dumping and technology leakages. Developing nations should be able to pursue an independent economic strategy. When trade threatens to undercut established social standards – whether in labour or environment – then there ought to be a mechanism for redress. Mr Trump identified some of what’s wrong with trade, but fighting with China won’t fix it.