In the Indian state of Assam, the authorities are building detention camps for “illegal immigrants”, most of whom are Indian citizens. In South Africa, hundreds of Nigerian workers have been airlifted home as anti-migrant violence spirals out of control.

Two different events in two different countries, but each a glimpse of the malevolent trends transforming politics globally. While neither event has received much attention in Britain, consumed as we are by all things Brexit, both throw light upon developments here, too.

Assam’s new detention centres are supposed to hold some of the 1.9 million people who last week were removed from the state’s updated version of the National Register of Citizens (NRC). It is the latest move by Assamese nationalists to deprive Muslims of citizenship and to declare them “illegal”.

More than a third of Assam’s population is Muslim, some of whose roots in the area go back centuries. They are as Indian as the prime minister, Narendra Modi. In the eyes of Hindu and Assamese nationalists, however, all Muslims are “infiltrators” and “Bangladeshis”. After the Bangladesh war of independence in 1971, when the old East Pakistan became an independent nation, thousands of refugees fled to India, providing a new source of Assamese grievance.

Modi’s Hindu nationalist party, the BJP, which controls the local state as well as the national government, has stoked that grievance and used the new citizenship register as a means to ethnically purge Assamese Muslims.

To be recognised as an Indian citizen in Assam, an individual must possess documentary evidence of their family having lived in the state, or having been Indian citizens, since before 25 March 1971, the day Bangladesh’s liberation war began. Many poor farmers and itinerant workers do not have paperwork to prove that they are citizens of the country in which they were born. The NRC is, in the words of one critical report, a process of “making foreigners” out of citizens.

Nigerians arrive in Lagos after being send back from South Africa on 11 September. Photograph: Pius Utomi Ekpei/AFP/Getty Images

How many of the 1.9 million Assamese excluded from the register will be imprisoned in the detention centres remains to be seen. What is certain is that the ugliness of nativist politics in India still has a long way to play out. While Indian authorities have been declaring their own citizens “foreigners”, in South Africa, foreigners, mainly migrants from other African nations, have faced a wave of violence that has left at least 12 dead. It is the latest eruption of the xenophobic rage that has scarred South Africa.

South Africa is the most unequal nation in the world. A quarter of the population live in extreme poverty. The true unemployment rate may be close to 40%. There is widespread anger that a quarter of a century after the end of apartheid the material conditions of most blacks have barely improved.

Migrants make a convenient scapegoat for beleaguered politicians. Last week, President Cyril Ramaphosa “condemned violence against foreign nationals”. Six months ago, he blamed migrants for South Africa’s social problems. ANC secretary-general Ace Magashule has painted foreigners as criminals. Opposition parties condemn the ANC for allowing migrants to “flood” in.

In fact, migrants neither steal jobs nor are disproportionately involved in crime. But facts matter little to unscrupulous politicians.

The events in India and South Africa are products of the specific circumstances of each country. Both also expose trends across the world in which notions of national belonging are becoming more constricted, minority groups increasingly targeted and immigrants bearing the blame for failures of policy and leadership.

These events are but more extreme versions of trends visible in Europe and America. Here, too, false claims that immigrants “steal our jobs” or are “responsible for most crimes” echo loudly. At the heart of Britain’s Windrush scandal was a “hostile environment” policy under which British citizens of the wrong skin colour were denied their rights because they were deemed to have insufficient documentation.

Whether in India, South Africa or Europe, the question asked is always: “What is the impact of immigration?” The answers given are usually false. The question almost never asked is: “What is the impact of anti-migrant hostility?” The answer is that it is deeply damaging and not just to migrants and minority groups. Anti-immigrant panics help erode the liberties of all citizens and obscure the real grievances that people face.

As the South African journalist Shaazia Ebrahim has observed: “The truth is that when the violence subsides, we’ll be left with the bare bones of reality: a failing government with a leadership vacuum and non-existent jobs in a motionless economy.” It’s not just South Africans who have to face up to that truth.

• Kenan Malik is an Observer columnist