This week’s nightmare is the arrival of Boris Johnson; the autumn brings the Brexit watershed. Soon after, the 2020 US election takes shape, compounding the sense that politics everywhere is in a state of complete unpredictability. All that is clear, perhaps, is that the forces gathered around Brexit, Donald Trump and the various brands of European populism still think things are going their way.

For some people, everything comes down to the failures of neoliberalism and its inbuilt globalisation, and the long aftershocks from the crash of 2008. Others, with very good reason, focus on racism and bigotry, and the spectacle of white men who are apparently convinced that their time at the top is about to come to a close and therefore lashing out. There are also people who seem to think that any sober, cause-and-effect explanations of a global crisis are impossible amid the mess: they tend to take refuge in rather specious ideas about “collective derangement” and national nervous breakdowns.

The ongoing transformation of production and consumption by computing power is everywhere

What is not mentioned nearly enough is actually plain to see. We live in a time of deep economic disruption. The ongoing transformation of production and consumption by computing power is everywhere: in hollowed-out town and city centres and a labour market that seems to be increasingly divided between tech-literate, university-educated people at the top, and those pushed down into work that is service-based, insecure and poorly paid. Digital innovation is not separate from but integral to the offshoring of jobs: technology allows companies to oversee production from a distance, and coordinate massively complicated modern supply chains. These things form the basic facts of our age, and a lot of political phenomena have to be understood accordingly.

This is the basic argument of a book I have been lost in for the last 10 days: The Technology Trap, by the Swedish-German economist and historian Carl Benedikt Frey. His basic thesis is that this phase of the 21st century is turning out to be very like the early 19th, in the sense that technology is causing a great crisis of status, security and trust in institutions. Back then, the stereotypical dissenter was a skilled weaver in a newly industrialising area of England, horrified by the arrival of mechanised mills and rightly fearing a collapse in esteem and earnings. Now, a global storm centres on similarly angry people – men, very often – in such US states as Ohio. “Not every manufacturing town there voted for Trump,” Frey writes. “But electoral districts specialising in industries that have invested heavily in automation overwhelmingly did.”

He points out that in these places, a whole swath of the old socioeconomic middle, encompassing everyone from machine operators to mortgage underwriters, has been shrinking away for at least three decades – and to lose a once secure job in these circumstances is to surrender any chance of comparable stability. Nonetheless, many people affected by such experiences have an enduring personal investment in an idea Frey terms the “disciplined self”: an idea invented as a means of “taking pride in monotonous toil on a factory’s assembly line”, bolstering the self-worth of male breadwinners.

‘Hardworking Americans.’ US president-elect Donald Trump visits a factory in Indianapolis, 2016. Photograph: Mike Segar/Reuters

In the US and elsewhere, this myth was long ago racialised by such things as the exclusion from trade unions of people of colour – and the idea, rooted in the mess of racist beliefs that swirled around slavery and empire, that the work ethic is somehow a white preserve. It is here that base prejudice and a crisis of economic status fuse together, something exemplified when Trump told last week’s already infamous rally in North Carolina that the black congresswoman Ilhan Omar “looks down with contempt on the hardworking American” – people who, as he well knows, may well be wondering if they will soon be doing any work at all and therefore looking for a scapegoat.

On the face of it, Britain may not fit quite as snugly into this picture of technological transformation feeding political (and moral) breakdown: so far, this country’s levels of manufacturing automation have lagged behind those of many other countries, and politicians hold up our supposedly low levels of unemployment as proof that if there is a storm, we are still riding it out. But we, too, have a story to tell about the links between a new industrial revolution and rising levels of resentment and rage.

I think I know what the immediate British economic future will look like, not least if Johnson and the Tories use Brexit as a pretext for kicking away whatever employment regulations we have left. Two years ago I visited the corporate headquarters of the online supermarket Ocado, in Hatfield, Hertfordshire. Its operations were divided in two by a supply road, along which hulking delivery lorries came and went. On one side software engineers, hardware inventors and marketing specialists worked on the business’s public face, and such innovations as robotic arms that will soon be able to handle no end of goods. Clutching coffees and dressed in functional casualwear, they looked happy and affluent. But over the road, pickers being paid between £8 and £10.65, and working often impossibly timed shifts, were dutifully doing many of the jobs that – as far as I understood it – would eventually be automated away.

People in this country know that in the absence of a professional middle, the chance of even relative affluence now depends on falling on the right side of this kind of divide, and that for millions of us, the challenges that entails are impossible. All those empty shops are a constant reminder that automation is eating away at the retail jobs that were once proffered as a replacement for those lost in manufacturing and heavy industry. Like the US, if our politics is now clouded by aggressive nostalgia and an aversion to thinking about the future, this is a key reason why.

So far, technology has not been one of the favoured themes of the western world’s populists, who are still much keener on talking about work and prosperity in the context of globalisation, trade and such supra-national institutions as the EU. But Frey’s book holds out the prospect of these politicians sooner or later floating the idea of somehow slowing the pace of automation so as to protect their supporters. History offers lessons here: given the convulsions of the industrial revolution led eventually to such liberating, job-creating innovations as mass access to electricity and the internal combustion engine, to do so would threaten things that, in the long run, will surely be to everyone’s benefit. Clearly, any convincing answer to technological disruption lies not in trying to deny the future, but coming up with the kind of ameliorative social programmes – housebuilding, huge changes to education, either a universal basic income or a system of basic social rights – that might both protect people and allow them to make the most of huge change. But when do you hear Trump, Johnson or Nigel Farage talk about any of that?

Herein lies a basic fact about the period in which we are still stranded, and the way that rightwing politicians send all the chaos into a kind of feedback loop. When I spoke to Frey last week, the conversation ended with an ultra-dry, aphoristic point that cut straight to the heart of 2019’s nightmares: “The short run can be extremely disruptive. And it can last for a very long time.”

• John Harris is a Guardian columnist