To those premature pundits who assured us that the global populist wave was already receding, Germany has just delivered an enormous raspberry. In one of the most prosperous countries in the world, with the strongest possible taboo on xenophobic, rightwing nationalism (A Hitler) and an existential commitment to European integration, one out of every eight voters has turned to a xenophobic, Eurosceptic, rightwing populist party, Alternative für Deutschland (AfD). One lesson to be learned is this: if we are to combat populism, we must understand that its deep driving forces are as much cultural as economic.

Of course there’s an economic component, even in Germany. Not all Germans are driving around in BMWs and contemplating their second holiday in Mallorca. Yet the economic motive is much less salient than it was in the votes for Donald Trump and Brexit. In a poll conducted for the German television channel ARD, 95% of AfD voters cited threats to “the German language and culture”.

As always, there are specific national causes. In this case, the two largest centrist parties, Social Democrats (SPD) and Christian Democrats (CDU), have been cohabiting in a “grand coalition” government for eight of the last 12 years. That has propelled disgruntled voters to the smaller parties and the extremes. Unlike the leaders of some other European centre-right parties, who have tacked to the right to pick up the populist votes, Angela Merkel has stayed with both feet planted firmly in the moderate, civilised, liberal centre. I have praised her for it in the past, and do so again now. But her centrist, even slightly left-leaning moderation had a price. The Bavarian CSU – the more conservative sister party to Merkel’s CDU – now loudly bemoans that “open right flank”.

Then there is the east-west divide, with strong support for rightwing, xenophobic populism in many parts of the former East Germany. There is an almost perfect symmetry here: the areas that produced the most votes for AfD, in the east, actually have the fewest immigrants. The East German phenomenon undoubtedly has much to do with the legacy of 40 years spent under a communist regime (a kind of political-psychological post-traumatic stress disorder, if you will), and the way in which the two unequal halves of a once-divided Germany have interacted since unification.

Yet rather clear geographical divides are also characteristic of other rightwing populisms: the Trump-supporting interior of the US, against the more liberal coasts; Brexit-supporting England-without-London against cosmopolitan London and pro-European Scotland; Law and Justice party rural, small town, eastern and south-eastern Poland against its more liberal big cities, west and north-west. For all the differences between these populist-voting regions, one finds in them a common feeling, a shared resentment, something like “we exist too, but you have been ignoring us, treating us as second-class parts of the country”.

The same is true of the social dimension. We focus too much on the strictly economic aspect of inequality. This certainly plays an important part in countries such as America and Britain, where globalisation in a neoliberal, financial-capitalist form has resulted in the top percentiles being disproportionately engorged with riches, while for the bottom half of society, real wages and household incomes have stagnated or declined. With growing socio-economic inequality has come a further decline in equality of opportunity. But this is not the characteristic pathology of populism in Germany or Poland.

I believe we need to think about more subtle, less easily measurable dimensions of inequality. I would call them inequality of attention and inequality of respect. Attention, as Tim Wu points out in his book The Attention Merchants, is one of the major currencies of our internet age. How much attention did our mainstream liberal media give, until recently, to the “left behind” regions and social groups? In Arthur Miller’s Death of a Salesman, Linda, the wife of poor, struggling Willy Loman, cries: “He’s a human being, and a terrible thing is happening to him. So attention must be paid. He’s not to be allowed to fall into his grave like an old dog. Attention, attention must finally be paid to such a person.”

Inequality of attention shades into inequality of respect. A phrase that has become almost proverbial on the Polish populist right is “redistribution of prestige”. It’s an odd phrase, at first hearing, but actually it captures something important. Redistribution is not just about money; it’s also about respect. Our societies have simply not delivered well enough on one of liberalism’s central promises, summarised by the legal philosopher Ronald Dworkin as “equal respect and concern” for each individual member of the society.

At the end of Alexander Payne’s lovely film Nebraska, the son of a battered, weary, old, white, working-class man buys his dad a gleaming pickup truck. The old man drives slowly down the main street of the town where he grew up, enjoying, just for once, the admiring glances of his childhood companions. Attention. Respect.

This, in turn, shades into the cultural dimension – so important in Germany, but not only there. “I don’t recognise my country any more” is the characteristic sentence of the rightwing populist voter. “On est chez nous” was the revealing chant of the supporters of the French Front National leader Marine Le Pen. Immigration is obviously a key factor here, especially when it comes linked to a real or imagined threat from Islam. In one recent Polish opinion poll, 42% of those asked said that Islamic terrorism was a major threat to Poland’s national security, despite the fact that the country has virtually no Muslims and has refused to take even its minimal EU quota of refugees from the Middle East.

But it’s not just immigration. It’s also issues such as abortion and gay marriage – and what is denounced as political correctness, meaning something like “there are so many old-fashioned things I’m not allowed to say any more”. Then the ranting Trump, Le Pen or AfD leader comes along and the voter exclaims: “At last, someone is telling it as it is!” And they complain that every other ethnic, religious and cultural group seems to be encouraged to have its identity politics – all except the native, “true” English, Americans, Poles or Germans, who feel embattled and ignored. Populism is their identity politics.

This is not the whole story, of course. In Europe, hostility to the EU, and specifically to the euro, is a major driver of populism. The AfD started life as an anti-euro party. But these social and cultural dimensions are common to most populisms – in Europe and beyond. So let’s listen to Linda Loman and pay attention. If we make the wrong diagnosis, we will never find the cure.

• Timothy Garton Ash is a historian, political writer and Guardian columnist. His personal website is timothygartonash.com. He directs the 13-language website freespeechdebate.com. His latest book is Free Speech: Ten Principles for a Connected World