Last June, I voted to leave the European Union. I wasn’t an anti-EU fanatic but I was, despite my advancing years, still something of a green idealist. I had always believed that small was beautiful, that people should govern themselves and that power should be reclaimed and localised whenever possible. I didn’t think that throwing the people of Greece, Spain and Ireland to the wolves in order to keep bankers happy looked like the kind of right-on progressive justice that some of the EU’s supporters were claiming it represented.

So I voted to leave. I didn’t say anything about this before the vote and, despite being a writer, I didn’t write about it either. There was too much mudslinging on both sides already, and I didn’t want to throw any more or have any thrown at me. In any case, I didn’t have much to say.

The mudslinging, it turned out, was just a prelude to what would come next. The EU referendum, like the election of Donald Trump in the US five months later, and the Scottish independence question, newly reopened this week, tore the plaster off a pre-existing national wound that now began to bleed freely. All sorts of things bubbled up that had been suppressed for years, and everyone was suddenly taking sides. Some people, when I told them that I’d voted to leave, looked at me as if I’d just owned up to a criminal record. Why would I do that? Was I a racist? A fascist? Did I hate foreigners? Did I hate Europe? I must hate something. Did I know how irresponsible I had just been? Had I changed my mind yet? I needed to go away and check my privilege.

The eruption of anger that followed the vote, on all sides, was surprising enough. But what was also surprising to me was the uniformity of opinion among people I had thought I shared a worldview with. Most people in the leftish, green-tinged world in which I had spent probably too much time over the years seemed to be lining up behind the EU. The public intellectuals, the Green party, the big NGOs: all these people, from a tradition founded on localisation, degrowth, bioregionalism and a fierce critique of industrial capitalism, were on board with a multinational trading bloc backed by the world’s banks, corporations and neoliberal politicians. Something smelt fishy.

***

I was born in the early 1970s. At around the same time, two forces – two movements, if you like – were also born that would shape the lives of my generation. One was neoliberalism. The other was environmentalism.

I had a sense that the world’s colour and beauty were being bulldozed away in the name of money and progress

Neoliberalism was an economic project. It sought to replace stuttering statist economic models with a new laissez-faire order by removing “barriers to trade” wherever they might be found. These barriers might be protectionist tariffs or taxes; they might also be national laws, local customs or environmental regulations. The creation of the World Trade Organisation in 1995 was the culmination of a decades-long project, pushed by the economic and military might of the United States and its allies, to globalise the neoliberal model and cement it in international law.

By the early 21st century it seemed that this globalisation process was both unstoppable and almost complete. Political parties from all traditions had surrendered to it, and the pundits and the economists were happily on board. In the process, the economic project had developed into a cultural one, promulgated by its beneficiary class, the urban, tech-savvy, cosmopolitan bourgeoisie. Often referred to as “globalism”, this worldview envisaged a borderless, one-world culture, in which trade tariffs and national boundaries were seen as equally damaging to the new hypercapitalist conception of freedom. Traditions, distinctive cultures, national identities, religious strictures, social mores – all would dissolve away in the healing light of free trade and a western liberal conception of social progress. Only bigots and luddites could possibly oppose such a utopian dream.

Being something of a luddite myself, I wrote a book, One No, Many Yeses, opposing it 15 years ago. It tracked the great wave of anti-globalisation movements that washed over the world at the end of the 20th century, from the summit blockades at Seattle, Prague and Genoa to the uprising of the Zapatistas in Mexico and the anti-privatisation riots in South Africa. What I found as I investigated these movements was that the most lasting of them were fuelled not by a general rage against “the system”, but by a sense of place and belonging. Somewhere that people loved or felt attached to was being threatened by outside forces, whether they be trade treaties, buccaneering corporations or oppressive governments, and people were fighting to defend what they knew and what they were.

This sense of the uniqueness of places, and of the cultures that sprang from them, had been what pushed me towards green activism in the first place. From a young age I had an inchoate sense that much of the world’s colour, beauty and distinctiveness was being bulldozed away in the name of money and progress. Some old magic, some connection, was being snuffed out in the process. It must be 20 years since I read the autobiography of the late travel writer Norman Lewis, The World, The World, but the last sentence stays with me. Wandering the hills of India, Lewis is ask by a puzzled local why he spends his life travelling instead of staying at home. What is he looking for? “I am looking for the people who have always been there,” replies Lewis, “and belong to the places where they live. The others I do not wish to see.”

As a writer, whether of fiction or non-fiction, I have been looking for the same thing. That first book of mine, it turned out, was a journey in search of people who belong. It was a defence of a threatened fragility. A few years later, I wrote another, this time about globalisation’s impact on England, my home country. I’ve since written novels and essays and poems and they always seem, however hard I try to write about something else, to circle back around to that primal question: what does it mean to belong to a place, to a people, to nature, in a time in which belonging is everywhere under attack? Does it mean anything? Why should it matter?

Standing Rock Sioux tribe resist the construction of an oil pipeline across Native American land near Cannonball, North Dakota. Photograph: Stephanie Keith/Reuters

All I know is that it matters to me. That was why I joined what I wanted to believe was a movement that could derail globalisation. For a while, it looked like it might. Then came 9/11, and a different kind of anti-globalisation movement – violent Islamism – began stalking the west. Governments cracked down on dissent and populations grew fearful. Everything suddenly seemed darker.

Still it seemed that nothing could stop the neoliberal train. It kept rolling, faster and faster, until in 2008 it hit a wall at full speed. Remarkably, it survived the crash. When the banks were bailed out and the corporations given another series of blank cheques, I gave up on the idea that much would ever change. The power of money seemed as stark as the stench of corruption. Perhaps neoliberalism was unstoppable after all. Perhaps, as Margaret Thatcher had once famously claimed, there was, indeed, no alternative.

***

On 24 June last year I woke up, made a cup of tea and turned on my computer, wondering by what margin the nation had voted to remain in the EU. On the BBC website, the headline seemed to take up the whole screen: BRITAIN VOTES TO LEAVE THE EUROPEAN UNION. Five months later, my morning seemed to repeat itself. I woke up, made another cup of tea, wondered how many votes Clinton had won by, and then gaped at the margin of Trump’s victory. It was clear the poles were shifting. Something big was going on.

On both occasions I can remember precisely how I felt. It was a feeling that had nothing to do with what might happen next, and it wasn’t really related to my opinions about any of the issues involved. The feeling was exhilaration. I suddenly realised that for the last decade I had believed, even though I had pretended not to believe, in the end of history. Now, the end of history was ending. Change was possible after all.

I also began to realise something else: the anti-globalisation movement had not died. Its impulse had driven Brexit as it had driven Donald Trump’s victory. It had driven Jeremy Corbyn’s rise, and those of Syriza in Greece and Bernie Sanders in the US. In their different ways and for different reasons, coalitions of people were again pushing back against the dehumanising world that the global economy was creating. Globalisation had been impoverishing the south for decades. Now it was impoverishing the west, too, and the discontent had reached boiling point.

‘Trump is notorious for his cavalier attitude to anything furry or leafy that gets in the way of his gaudy developments.’ Photograph: Evan Vucci/AP

But change is a trickster and it makes no promises. Back in the day, those of us who fancied ourselves as radicals thought we were the shock troops in the battle against globalisation. As a young greenie, I would consume the words of Edward Abbey and Murray Bookchin, Vandana Shiva and EF Schumacher, James Lovelock and Dave Foreman. These were the people who were constructing the sane future, and I wanted to join them. Campaigning environmentalists, the “social justice” movement, the lefties and the greens: we would be the heroes of the coming hour. Our rational solutions to climate change, our well-argued deconstructions of neoliberalism, our piles of evidence about the negative impact of trade treaties, our righteous demands for justice – these would shake the world. When they learned the truth about the continuing corporate stitch-up, the people would rise up in opposition.

They did rise up in the end, but it wasn’t us they were listening to. The message had found a different messenger. There is, said Trump in his last TV spot before election victory, “a global power structure that is responsible for the economic decisions that have robbed our working class, stripped our country of its wealth and put that money into the pockets of a handful of large corporations and political entities”. They were words that could have been heard at any social forum, anti-globalisation gathering or left-green beanfeast from the last 20 years, as could the rousing final sentence: “The only thing that can stop this corrupt machine is you.”

•••

In a penetrating essay in The American Interest last July, social psychologist Jonathan Haidt sought to place all this in context. He suggested that the old left-right political divide, which had been looking iffy for years, was being supplanted by a new binary: globalism versus nationalism. Nationalism, in the broadest sense of the term, was the default worldview of most people at most times, especially in more traditional places. It was a community-focused attitude, in which a nation, tribe or ethnic group was seen as a thing of value to be loved and protected. Globalism, the ideology of the rising urban bourgeoisie, was more individualistic. It valued diversity and change, prioritised rights over obligations and saw the world as a whole, rather than particular parts of it, as the moral community to which we all belong.

The current explosion of nationalism in the west, Haidt said, was due to globalism having overplayed its hand. Different attitudes to the issue of mass immigration – the spark that lit the fire on both sides of the Atlantic – demonstrated how this had happened. While globalists saw migration as a right, nationalists saw it as a privilege. To a globalist, border walls and immigration laws are tantamount to racism or human rights abuse. To a nationalist, they are evidence of a community asserting its values and choosing to whom to grant citizenship. Psychologically, Haidt suggested, what happened in 2016 was that many nationalist-inclined voters in the west felt that their community was now under existential threat – not only from large-scale migration, but from Islamist terrorist attacks and the globalist elite’s dismissive attitude to their concerns about both. In response, they began to look around for strong leaders to protect them. The rest is history, still in the making.

To a globalist, borders are tantamount to racism. To a nationalist, they're evidence of a community asserting its values

This is the power of the new populists. The likes of Stephen Bannon and Marine Le Pen understand the destructive energy of global capitalism as well as the left does, but they also understand what the left refuses to see: that the heart of the west’s current wound is cultural rather than economic. What is driving the modern turmoil are threats to identity, culture and meaning. Waves of migration, multicultural policies, eroding borders, shifting national and ethnic identities, globalist attacks on western culture: all that is solid is melting into air.

Who can promise the return of that solidity? Not the left, which long ago hitched its wagon to the globalist horse, enthusing about breaking down everything from gender identities to national borders and painting any dissent as prejudice or hatred. Instead, a new nationalism has risen to the occasion. As ever, those who can harness people’s deep, old attachment to tribe, place and identity – to a belonging and a meaning beyond money or argument – will win the day. This might be as iron a law as any human history can provide.

•••

It didn’t take Trump’s cabinet of millionaires long, having got themselves comfortable in the White House, to start dismantling the nation’s environmental protections. Two months in, the administration has given the green light to two controversial oil pipelines and removed environmental oversight on others, cancelled Obama’s climate action plan, removed regulations pro tecting clean water and appointed a former head of ExxonMobil as secretary of state. Anti-green campaigner Myron Ebell, who believes that environmentalism is “the greatest threat to freedom and prosperity in the modern world” was asked to head Trump’s transition team for the Environmental Protection Agency, which he wants to abolish, and which has just seen its budget slashed by 25%.

Trump himself is notorious for his cavalier attitude to anything furry or leafy that gets in the way of his gaudy developments. The natural world has always been an inconvenient barrier to economic growth, which is why we are faced with a global ecological crisis. But Trump’s anti-environmentalism, while it serves the interests of corporations, speaks the language of the people. In his telling, protecting the natural world from destruction is another example of the globalist elite sticking it to ordinary folk.

The notion that environmentalists are a privileged elite telling the hard-pressed that they can’t have decent lives has been a staple of corporate propaganda for decades. Look at these horrible elitists, runs the line, trying to abolish your hard-earned holiday flights and double the price of your car journey. Who are they to tell you that you can’t give your children plastic toys at Christmas, or eat air-freighted avocados? Have you seen the size of Al Gore’s house? Hypocrites!

Like all effective propaganda lines, this one works because there is some truth in it. The environmental movement that emerged in the west more than 40 years ago, with the founding of organisations such as Greenpeace and Friends of the Earth and the birth of green parties across Europe, had its roots in the conservation world. While its outlook was planetary – no true ecological movement can be anything else – its actions were often local or national. “Think globally, act locally”, perhaps the movement’s most effective early slogan, looks in retrospect like a beautiful combination of the best of the globalist and the nationalist impulses.

A mountain lion in Flathead River, Montana. Photograph: Getty Images/Panoramic

These days, though, as the Brexit vote demonstrated, green politics is a marker of the globalist class. With their grand ecological Marshall plans and their talk of sustainability and carbon, environmentalists today often seem distant from everyday concerns. Green spokespeople and activists rarely come from the classes of people who have been hit hardest by globalisation. The greens have shifted firmly into the camp of the globalist left. Now, as the blowback gathers steam, they find themselves on the wrong side of the divide.

All this can look like bad news from a certain perspective, but maybe it isn’t. While environmentalism has changed the world in the last four decades, in recent years it has been spinning its wheels. Increasingly unrealistic demands for global action on climate change, pie-in-the-sky manifestos calling for global rollouts of this or that eco-megaplan, the promotion of enormous windfarms or solar arrays that do more damage to wild nature than they prevent, all backed with a “40 months to save the world” narrative that’s been going on for 40 years: something had to give.

Some of the new populists may hope they can sound the death knell of the green movement, but perhaps they can instead teach it a necessary lesson. What Haidt calls nationalism is really a new name for a much older impulse: the need to belong. Specifically, the need to belong to a place in which you can feel at home. The fact that this impulse can be exploited by demagogues doesn’t mean that the impulse itself is wrong. Stalin built gulags on the back of a notional quest for equality, but that doesn’t mean we should give up on trying to make things fair.

The anti-globalist attack on the greens is a wake-up call. It points to the fact that green ideas have too often become a virtue signal for the carbon-heavy bourgeoisie, drinking their Fairtrade organic coffee as they wait for their transatlantic flight. Green globalism has become part of the growth machine; a comfortable notion for those who don’t really want much to change.

Any attempt to protect nature from the worst human depredation has to speak to people where they are

What would happen if environmentalism remade itself – or was remade by the times? What might a benevolent green nationalism sound like? You want to protect and nurture your homeland – well, then, you’ll want to nurture its forests and its streams too. You want to protect its badgers and its mountain lions. What could be more patriotic? This is not the kind of nationalism of which Trump would approve, but that’s the point. Why should those who want to protect a besieged natural world allow billionaire property developers to represent them as the elitists? Why not fight back – on what they think is their territory?

It has been done before. The nation that gave us Trump also gave us Teddy Roosevelt, another Republican populist president, but one who believed that America’s identity was tied up with protecting, not despoiling, its wild places. Roosevelt created one of the greatest systems of protected areas and national parks in the world, using his presidency to save 230m acres of land. “We have fallen heirs to the most glorious heritage a people ever received,” he wrote, “and each one must do his part if we wish to show that the nation is worthy of its good fortune.” Protecting nature, believed Roosevelt, was a patriotic act.

If I had to offer up just one thing I have learned from my years of environmental campaigning, it would be this: any attempt to protect nature from the worst human depredation has to speak to people where they are. It has to make us all feel that the natural world, the non-human realm, is not an obstacle in the way of our progress but a part of our community that we should nurture; a part of our birthright. In other words, we need to tie our ecological identity in with our cultural identity.

In the age of drones and robots, this notion might sound airy or even ridiculous, but it has been the default way of seeing for most indigenous cultures throughout history. In the resistance to the Dakota Access pipeline, recently given the go-ahead by Trump, where the Standing Rock Sioux and thousands of supporters continue to resist the construction of an oil pipeline across Native American land, we perhaps see some indication of what this fusing of human and non-human belonging could look like today; a defence of both territory and culture, in the name of nature, rooted in love.

Globalism is the rootless ideology of the fossil fuel age, and it will fade with it. But the angry nationalisms that currently challenge it offer us no better answers about how to live well with a natural world that we have made into an enemy. Our oldest identity is one that stills holds us in its grip, whether we know it or not. Like the fox in the garden or the bird in the tree, we are all animals in a place. If we have a future, cultural or ecological – and they are the same thing, in the end – it will begin with a quality of attention and a defence of loved things. All else is for the birds, and the foxes too.

• Paul Kingsnorth’s new book, Confessions of a Recovering Environmentalist, is published by Faber. To order a copy for £12.74 (RRP £14.99) go to bookshop.theguardian.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min p&p of £1.99.