The west is being destroyed, not by migrants, but by the fear of migrants. In country after country, the ghosts of the fascists have rematerialised and are sitting in parliaments in Germany, in Austria, in Italy. They have successfully convinced their populations that the greatest threat to their nations isn’t government tyranny or inequality or climate change, but immigration. And that, to stop this wave of migrants, everyone’s civil liberties must be curtailed. Surveillance cameras must be installed everywhere. Passports must be produced for the most routine of tasks, like buying a mobile phone.

Take a look at Hungary, where Viktor Orbán has forced out the Central European University and almost destroyed the country’s free press and most other liberal institutions, using immigrants and George Soros as bogeymen. Or Poland, whose ruling party purged the judiciary, banished political opponents from government media, greatly restricted public gatherings and passed a law, modified only after an international outcry, making it a crime to accuse Poland of complicity in the Holocaust. Or Austria, where the neo-Nazis in the governing coalition want to fail kindergarteners for not knowing German. Or Italy, where a fanatically anti-immigrant coalition that won power is now going after the Roma. All these rode to power, or intensified their grip on it, like Orbán, by stoking voters’ fear of migrants, promising to ban new immigrants and to take away the rights of immigrants already in the country. Once in power, they energetically set about depriving everyone else of their rights, migrants or citizens.

It is a successful strategy for the fearmongers. Driven by this fear, in country after country voters are electing leaders who are doing incalculable long-term damage. And some liberal politicians blame not the fearmongers or the people who vote for them – but the migrants. “Europe needs to get a handle on migration,” declared Hillary Clinton in November 2018. It “must send a very clear message – ‘We are not going to be able to continue to provide refuge and support’ – because if we don’t deal with the migration issue it will continue to roil the body politic.”

The economist Jennifer Hunt tells a story about visiting Germany recently and listening to people making the liberal argument against letting in refugees: “If we let these people in, we’ll have the far right in government.” Hunt’s response: “If you don’t let these people in, you’ve already become a far-right government.”

Jews fleeing Nazi-occupied Europe were the harbinger of today’s global migrants; many of today’s covenants that protect refugees came into existence in response to their predicament. So it is particularly painful to hear that among the first armies in our time to shoot at people crossing the border looking for asylum was the Israeli army. In 2015, Israeli soldiers fired on African migrants crossing the Egyptian border, wounding a number of them. In December 2017, the Knesset passed a law under which the 40,000 asylum seekers in Israel “will have the option to be imprisoned or leave the country”.

It was fear of migrants, principally, that led the British to vote for Brexit, the biggest own goal in the UK’s history. A YouGov poll in the days before Brexit found that 56% of Britons named “immigration and asylum” as the biggest issue facing the country. Tabloids with headlines such as “Migrants Rob Young Britons of Jobs” and “Britain’s 40% Surge in Ethnic Numbers” stoked fear of outsiders, day after day. From 2010 to 2016, the Daily Express ran 179 front-page anti-immigration stories and the Daily Mail 122 similar front-page jeremiads.

Facebook Twitter Pinterest David Cameron, then UK prime minister, and Theresa May, then home secretary, with Home Office officers in 2014 at a house where several migrants were arrested in Berkshire. Photograph: Oli Scarff/PA

In the US, voters motivated by an utterly irrational fear and hatred of immigrants elected in 2016 a leader who might end up being the most destructive in the country’s history. In surveys, Donald Trump’s promise to build a wall between the US and Mexico was the single most important factor cited by former Democrats who voted for Trump, including women. When Congress refused to fund his wall, he shut down the government itself for the longest period the nation had ever known, causing enormous economic and political damage.

For much of the 20th century, America’s greatest threat was from outside: Japan, the Soviet Union. Later it was al-Qaida. Now we realise that the greatest peril comes from within, from the heartland: Queens, New York. Only a year into his presidency, Trump had succeeded in making the country I call home the most polarised I have ever seen it. Democrat versus Republican, Anglo versus Latino, urban versus rural, rich versus poor, men versus women: people are at each other’s throats as never before.

A battle is being fought today in the public squares, at political conventions, on the television, in the opinion pages: a battle of storytelling about migrants. Stories have power, much more power than cold numbers. That’s why Trump won the election; that’s why Orbán, India’s Narendra Modi and the Philippines’ Rodrigo Duterte won power. A populist is, above all, a gifted storyteller, and the recent elections across the world illustrate the power of populism: a false narrative, a horror story about the other, well told.

The fear of migrants is magnified by lies about their numbers; politicians and racists train minds to think of them as a horde. In all the rich countries, people – especially those who are poorly educated or rightwingers – think immigrants are a much bigger share of the population than they really are, and think that they get much more government aid than they really do. A recent study found that Americans, as an overall average, think the foreign-born make up around 37% of the population; in reality, they are only 13.7%. In other words, in the American imagination, we are three times as numerous as we are in reality. The French think that one in three people in their country is Muslim. The actual number is one in 13. British respondents to the poll predicted that 22% of the people will be Muslim by 2020; the actual projection is 6%.

A quarter of the French, one in five Swedes and one in seven Americans think immigrants get twice as much in benefits as the native-born. This is not remotely true in any of these countries. Americans estimate that a quarter of all immigrants are unemployed; in reality, under 5% are.

Facebook Twitter Pinterest An anti-migration billboard in Budapest from the Hungarian government. Photograph: Darko Vojinović/AP

But there are also countertrends and counterexamples. Multiple studies have found that people who have direct contact with immigrants have much more positive views about their work ethic and reliance on welfare, and are much more open to increased immigration. And there are leaders who welcome migrants, however embattled they may be. Look at France, which elected the unapologetically pro-immigrant Emmanuel Macron, or Germany under Angela Merkel, which welcomed a million refugees in 2015. Above all, consider Canada, where the Justin Trudeau government declared its intention to increase the flow of immigrants, and whose economy had the strongest growth in the G7 in 2017 – 3% a year, as opposed to the 2.3% in Trump’s US (although the gap disappeared in 2018, thanks to Trump’s massive tax giveaways to the rich and to corporations). Hate crimes against Muslims actually went down in Canada in 2017; in its southern neighbour, they jumped by 5%.

This shows that when countries safeguard the rights of their minorities, they also safeguard, as a happy side effect, the rights and economic wellbeing of their majorities, or other minorities within the majority. If a judiciary forbids discrimination against, say, Muslims, it is also much more likely to forbid discrimination against, say, gay people. The obverse is also true: when they don’t safeguard the rights of their minorities, every other citizen’s rights are in peril.

Every majority is composed of a set of discrete minorities. When you go after Palestinians and Africans in Israel, the Reform Jews are next. When you go after Muslims in India, the Christians are next. When you go after Muslims and Mexicans in America, the Jews and gays are next. The early targets are easy to hit, under the cover of nationalism. But hate, once fed, grows ever more ravenous. It is never satisfied.

But where does the hate come from? How was it generated? Our time is one in which, after a postwar openness to migrants, that hatred has resurfaced. Where does this fear and loathing of migrants come from? It didn’t start with the yobs on the street, the skinheads marching in leather, the torch-bearing white supremacists. The hatred has been manufactured. It is an Old World idea. While the colonisers ruled over the colonies – and the slave owners in the New World over the slaves – they also began to find it essential to distinguish themselves from their subject peoples, to hold themselves morally, intellectually and civilisationally superior to them. Otherwise, where would the colonial enterprise end? In intermarriage and race degradation. Since there were so many more of them than there were of the colonists, the tiny number of colonial officers would dissolve into a larger sea. Gandhi put the numbers in perspective: “If we Indians [in 1947, 390 million strong] could only spit in unison, we would form a puddle big enough to drown 300,000 Englishmen.”

So, over the years, there’s been a rich vein of hysterical European, particularly French, literature on the subject. Much of it is about Calcutta, epicentre of western fears – and my birthplace. The legend began with the “Black Hole”, a small prison in which 146 British prisoners of war were locked up for three days in the stifling June of 1756 by an Indian nawab; only 23 survived. Ever since then, the popular image of Calcutta has been that of a giant urban black hole: overcrowded, hot, filthy.

Facebook Twitter Pinterest ‘An Old World idea’ … US white supremacists march in Charlottesville, Virginia, in 2017. Photograph: The Washington Post/Getty

The once-renowned environmentalist and Stanford biologist Paul Ehrlich begins his enormously influential 1968 book The Population Bomb (published by the Sierra Club) with another hysterical epiphany, this time in Delhi:

“I have understood the population explosion intellectually for a long time. I came to understand it emotionally one stinking hot night in Delhi a few years ago. My wife and daughter and I were returning to our hotel in an ancient taxi. The seats were hopping with fleas. The only functional gear was third. As we crawled through the city, we entered a crowded slum area. The temperature was well over 100, and the air was a haze of dust and smoke. The streets seemed alive with people. People eating, people washing, people sleeping. People visiting, arguing, and screaming. People thrusting their hands through the taxi window, begging. People defecating and urinating. People clinging to buses. People herding animals. People, people, people, people. As we moved slowly through the mob, hand horn squawking, the dust, noise, heat, and cooking fires gave the scene a hellish aspect. Would we ever get to our hotel? All three of us were, frankly, frightened.”

Ehrlich and his family emerged from the taxi awakened to the peril: “an utter breakdown of the capacity of the planet to support humanity”. This epiphany led Ehrlich to advocate that the US condition its food aid to poor nations, like India, on those countries sterilising their males.

“The United States could take effective unilateral action in many cases … When we suggested sterilising all Indian males with three or more children, we should have applied pressure on the Indian government to go ahead with the plan. We should have volunteered logistic support in the form of helicopters, vehicles, and surgical instruments. We should have sent doctors to aid in the program by setting up centers for training paramedical personnel to do vasectomies. Coercion? Perhaps, but coercion in a good cause. I am sometimes astounded at the attitudes of Americans who are horrified at the prospect of our government insisting on population control as the price of food aid. All too often the very same people are fully in support of applying military force against those who disagree with our form of government or our foreign policy. We must be just as relentless in pushing for population control around the world.”

Your belly or your dick: you choose! Ehrlich and his wife, Anne, were leading advocates for restricting immigration to the US – because all those extra people would be bad for the environment – and for restoring ethnic quotas on immigration. He predicted that 4 billion people, including 65 million Americans, would die because the planet was incapable of feeding them. “Sometime in the next 15 years,” Ehrlich predicted, “the end will come.” This was in 1970.

None of this actually happened, of course – and India, Ehrlich’s nightmare country, is actually reaping the demographic dividend of a workforce with a median age of 27. But there’s something about brown and black people reproducing that has always horrified western thinkers and leaders. Winston Churchill, in 1945, opined that Hindus are “protected by their mere pullulation [rapid breeding] from the doom that is their due”.

We are seeing a new red scare, except this time the enemy isn’t communists; it’s immigrants. The US Immigration Enforcement and Border Patrol raids, grabbing mothers on the streets and hustling them into government vans in front of their screaming daughters, are reminiscent of the Palmer Raids in 1919 and 1920, when hundreds of suspected leftists who were foreign, or looked or sounded foreign, were rounded up and deported. Obama was better in his language than Trump, but not much better in his policies. He was called the “deporter in chief” by immigrant advocates because of his record of forcibly removing 3 million people without proper papers – a far higher number than Bill Clinton or George W Bush had removed. Obama expended little serious political capital to make life easier for the undocumented during his eight years in office, pleading political gridlock under a Tea Party-controlled Congress, although he did sign executive orders protecting the Dreamers in his second term.

What are whites so afraid of? In a 2018 column, the paleoconservative commentator Pat Buchanan pointed out the political ramifications of today’s immigration: “In US presidential elections, persons of colour whose roots are in Asia, Africa and Latin America vote 4-1 Democratic, and against the candidates favored by American’s [sic] vanishing white majority.” Then he painted a picture of the looming apocalypse: “Mass immigration means an America in 2050 with no core majority, made up of minorities of every race, colour, religion and culture on earth, a continent-wide replica of the wonderful diversity we see today in the UN General Assembly.”

Today, these jeremiads against migrants are given vent full-throated on Fox News. The Fox anchors claim they are not anti-immigrant; they just want immigrants to come lawfully. The commentator Tomi Lahren often tweets imprecations at immigrants: “We are indeed a nation of immigrants. We are also a nation of laws. Respect our laws and we welcome you. If not, bye.”

Facebook Twitter Pinterest A Donald Trump rally in El Paso, Texas, in February 2019. Photograph: Joe Raedle/Getty Images

An amateur genealogist named Jennifer Mendelsohn dug up a 1917 court case featuring Lahren’s great-great-grandfather, a Russian immigrant named Constantin Dietrich. He was indicted on two counts of “wilfully, unlawfully, and knowingly” lying about a naturalisation proceeding and forging a naturalisation document “with a knife or steel eraser or other instrument unknown to the Grand Jurors”. He had failed to file his application in time, so he forged it to make it appear that it had been executed two years earlier.

“Migrant memoirs and other documents are full of examples of people who lied,” points out Hasia Diner, a professor of American Jewish history at New York University. “They lied about their ages, they lied about their occupations. The word went through immigrant ships and stations and ports of embarkation, to say that one had a particular skill. People lied to leave Europe, because they could be liable for military conscription.”

Get the Guardian’s award-winning long reads sent direct to you every Saturday morning

The most notorious immigrant hater in the Trump administration is his adviser Stephen Miller, who grew up Jewish in California. Miller’s great-grandparents Wolf and Bessie Glotzer were refugees fleeing the pogroms in Belorussia. They came over in 1903, without hindrance of extreme vetting or even an interview with the American embassy, with $8 in their pockets.

“For Miller to say his family came to America ‘legally’ is simply a ruse,” the Jewish Journal pointed out. “There was no illegal immigration at the turn of the century, because all non-Asian immigration was essentially legal until the 1920s. Then, as now, angry voices fought to keep these immigrants out. They organised the Immigration Restriction League, focused on shutting the ports to swarthy Italians and Jews. “The floodgates are open,” wrote one anti-immigrant newspaper editor as the eastern European Jews docked in New York. ‘The horde of $9.60 steerage slime is being siphoned upon us from Continental mud tanks.’ Such sentiments led to the Immigration Quota Act of 1924 – which effectively shut the door to Jewish immigration on the eve of the Holocaust.”

As the article notes: “When an American Jew turns on immigrants, there is a whiff of head-scratching hypocrisy, if not something more clinical. It is taking the side of people who, in a historical blink of the eye, would have met your own great-grandparents at the docks with stones and spitballs.”

Miller’s own uncle, David Glosser, posted a Facebook note: “My nephew and I must both reflect long and hard on one awful truth. If in the early 20th century the USA had built a wall against poor desperate ignorant immigrants of a different religion, like the Glossers, all of us would have gone up the crematoria chimneys with the other 6 million kinsmen whom we can never know.’

Fear of migrants earns politicians votes. Fear of migrants sells. Fox ratings have never been higher. The Springer newspapers in Germany, the Berlusconi papers in Italy and the Sun and Daily Mail in the UK are flourishing, feeding their readers a daily diet of xenophobia.

But the greatest facilitator of race-hatred against refugees isn’t a tabloid; it’s Facebook. Researchers at the University of Warwick recently studied every anti-refugee attack – 3,335, over two years – in Germany. They found that among the strongest predictors of the attacks was whether the attackers are on Facebook. The social network aids the dissemination of rumours, such as that all refugees are welfare cheats or rapists; and, unmediated by gatekeepers or editors, the rumours spread, and ordinary people are roused to violence. Wherever Facebook usage rose to one standard deviation above normal, the researchers found, attacks on refugees increased by 50%. When there were internet outages in areas with high Facebook usage, the attacks dropped significantly.

The conversation about immigrants in America, too, is approaching incitement to genocide. Not just restraining or detaining the undocumented, but murdering them en masse. Virgil Peck, a Kansas state assemblyman, offered a solution to America’s immigration problem in the legislature during a 2011 committee meeting on shooting wild hogs from helicopters: “If shooting these immigrating feral hogs works, maybe we have found a [solution] to our illegal immigration problem.” He later said that he’d been joking, that he was just speaking like “a south-east Kansas person”.

These comments were mirrored in February 2013 by a conservative radio show host and former US Navy Seal named Carl Higbie. “What’s so wrong with wanting to put up a fence and saying: ‘Hey, everybody with a gun, if you want to go shoot people coming across our border illegally, you can do it fo’ free’?” Higbie said on his radio show, Sound of Freedom. “And you can do it on your own, and you’ll be under the command of the, you know, National Guard unit or a Border Patrol. I think stick a fence six feet high with signs on it in both English and Spanish and it says, ‘If you cross this border, this is the American border, you cross it, we’re going to shoot you’ ... You cross my border, I will shoot you in the face. I will go down there. I’ll volunteer to go down there and stand on that border for, I don’t know, a week or so at a time, and that’ll be my civil duty. I’ll volunteer to do it.”

What happened to this homicidal, hate-filled man? Four years later, Donald Trump appointed him to be head of external relations for AmeriCorps, the national volunteer service programme. After the comments came out in the wider media, he resigned.

In February 2018, the US Citizenship and Immigration Services (USCIS) removed the phrase “nation of immigrants” from its mission statement. It will no longer secure “America’s promise as a nation of immigrants”; it will now merely “administer the nation’s lawful immigration system”. This was met with wide applause from anti-immigrant groups like Fair and Numbers USA. The Peruvian-born then head of USCIS, Lee Cissna, explained the change: that the agency now exists “to ensure people who are eligible for immigration benefits receive them, and those who are not eligible – either because they don’t qualify or because they attempt to qualify by fraud – don’t receive them, and those who would do us harm are not granted immigration benefits”. In other words, a sort of immigrant monitor, ever on the alert for criminals, terrorists, rapists, malingerers, deadbeats, cheats.

Even if they are observed more in the breach, these official catchphrases such as “nation of immigrants” mean something: what the country’s ideals are, what it aspires to. In changing the phrasing, USCIS removed even that aspirational ideal. It announced in no uncertain terms its idea of America: a nation of immigrant-haters.

Two Indian engineers were having beers on the porch of a bar in Kansas earlier that year. A white navy veteran came up to them. “Where are you from?” he demanded. ‘How did you get into this country?’ Other people in the bar shooed him off. The questioner came back with a 9mm gun. “Get out of my country!” he yelled, and shot both of them; one of them died. He was 32 and left a wife he’d been married to for just four years. She was waiting for her husband to come home so they could sip chai together in the backyard that unseasonably warm February evening.

How the media contributed to the migrant crisis Read more

Every year, extremists murder people for their views. The Anti-Defamation League noted: “A majority of the 2017 murders were committed by rightwing extremists, primarily white supremacists, as has typically been the case most years. The white supremacist murders included several killings linked to the alt-right as that movement expanded its operations in 2017 from the internet into the physical world – raising the likely possibility of more such violent acts in the future.” Between 2008 and 2017, white supremacists accounted for 71% of deaths in terror attacks in the US.

The researcher Lyman Stone has calculated the ancestries of all the people charged with terrorism in America since 2001. More than half – 227 – have “no foreign citizenship, parentage, or identifiable ancestry of any kind”. That is, they’re Americans, in the generic sense. We have met the enemy, and he is us.

• This article was amended on 28 August and 16 September 2019: to clarify a detail about the Kansas shooting; and to clarify that the Israeli army was among the first armies in our time, not the first, to shoot at asylum seekers.

This is an edited extract from This Land Is Our Land by Suketu Mehta, published by Jonathan Cape and available at guardianbookshop.co.uk

• Follow the Long Read on Twitter at @gdnlongread, and sign up to the long read weekly email here.