Politicians used to pretend the working class didn’t exist; now they zealously compete for working-class affection. “We’re all middle class now” was New Labour’s mantra in the 90s and 00s. “Class is a communist concept,” declared Margaret Thatcher. “It groups people as bundles and sets them against one another.” Class is no longer banished to the fringes of politics: it is becoming a defining concept once again.

The movement that unexpectedly catapulted Jeremy Corbyn into the Labour leadership places class at its heart. Ukip seeks to position itself as the party of the English and Welsh working class. Ukip “represents the concerns of most working-class men and women”, declared Mark Reckless after his short-lived victory in the 2014 Rochester and Strood byelection. And now it’s the Tories’ turn: they have shed the patronising formulation of “hard-working families doing the right thing” in favour of an audacious claim to be “squarely at the service of ordinary working-class people”. The return of class politics is an opportunity for Labour – and also a looming existential crisis.

Labour was founded to be the political arm of the working class. Social democracy across the western world existed to offer these wealth creators political representation, and to reorder societies otherwise run in the interests of industrialists and landlords. But the party emerged when working-class Britain toiled as steelworkers, miners, factory workers, personal servants. The workforce was dominated by men, and it was overwhelmingly white. Communities centred around places of work.

The left in general had a clear message: the problems and insecurities you experience are byproducts of a society that puts profit ahead of your needs and ambitions. Those responsible for injustice are those with power. Injustice is a collective failing that needs a collective solution.

It is all more complicated these days. The rise of the new right in the 1970s promoted individualism as the antidote to a supposedly suffocating collectivism. The mass sale of council housing was intended to promote individual over collective identity: “embourgeoisement” – or becoming bourgeois – as Margaret Thatcher’s “mad monk” Keith Joseph put it.

Trade unions – which gave organised power to a large swath of working-class Britain – were battered by government policies, mass unemployment and industrial defeat. The old industrial working class gave way to a more fragmented service-sector workforce. University-educated public-sector workers and middle-class professionals grew in number: they abhorred the social conservatism of the Tories, but had a different set of values and priorities to traditional working-class Britain, introducing a new tension in Labour’s electoral coalition.

How the end of the cold war was spun – total victory for free-market capitalism – led to a collapse in the left’s vision and confidence. Mass immigration diversified working-class Britain – indeed, it is working-class communities that tend to be the most ethnically mixed – but also led to unchecked resentment. New Labour’s failure to undo the social dislocation of Thatcherism – for example, overseeing a continued collapse in manufacturing jobs, and improving existing housing but failing to build more – led to growing frustrations. The left had no clear, accessible explanation about growing social insecurities: anti-immigration resentment filled the vacuum.

It’s now clear that a return to class politics was inevitable. A financial elite plunged the country into its worst economic crisis since the 1930s, suppressing the living standards of millions who shared no blame for it. A Conservative government dominated by public school millionaires introduced policies that damaged the lives of those from strikingly less privileged backgrounds. Workers suffered the longest real fall in wages since the 19th century, while the richest 1,000 Britons experienced a doubling in wealth. And then the Brexit vote happened: who can credibly claim “we’re all middle-class” in its aftermath? Working-class Britain is not homogeneous, and millions of working-class people – particularly from black and minority ethnic backgrounds – voted to remain. But there is no escaping the fact that middle-class professionals were the only demographic with majority support for remain, or that those on lower incomes plumped decisively for Brexit.

And here is the danger, one that has long caused me deep concern.

Six years ago, in the book Chavs: The Demonization of the Working Class, I wrote: “The danger is of a savvy new populist right emerging, one that is comfortable talking about class and offers reactionary solutions to working-class problems. It could denounce the demonisation of the working class and the trashing of its identity. It could claim that the traditional party of working-class people, the Labour party, has turned its back on them.

“Rather than focusing on the deep-seated economic issues that really underpin the grievances of working-class people, it could train its populist guns on immigration and cultural issues. Immigrants could be blamed for economic woes; multiculturalism could be blasted for undermining ‘white’ working-class identity.” It doesn’t seem far between that and a populist prime minister who says: the enemies of working-class Britain are immigration and a metropolitan liberal elite with contempt for their patriotism and values.

Economic liberalism never really grew roots in Britain. Theresa May knows this and, rhetorically at least, as she reinforced in her speech yesterday, she is abandoning support for it in favour of an active state. This could be lethally effective. It also underlines why the old New Labour approach – the wedding of economic and social liberalism – is irrelevant.

That is of little comfort to today’s Labour leadership. University-educated middle-class professionals may take to Twitter to vent, but it is their cultural distance from working-class communities that May seeks to exploit. Thatcherism attracted working-class support with carrots such as right-to-buy; today Mayism seeks to bind together an electoral coalition with resentment of immigration and metropolitan elites. May’s government is seeking a harsh Brexit that is set to damage the living standards and security of working-class people. If Labour doesn’t present a clear and compelling alternative vision, then frustration at the reality of Brexit will be funnelled into even more intense anti-immigration anger.

Jeremy Corbyn toyed with progressive patriotism in his leader’s speech; he should persist with that and he must be positive. For as Labour thinker Jon Cruddas has pointed out, the party wins when it presents an optimistic vision of national reconstruction.

There is anti-establishment fury. It underpinned the Brexit result and Labour must tap into it. But unlike the Tories, it must direct this towards the correct targets, the vested interests who are really holding Britain back.

Labour was born of class politics, whose re-emergence is an opportunity. But if Labour fails to grasp it, be sure that the populist right will.