Every time there is violence of a particular sort in SA I think about 1949. In mid-January of that year a single incident between an Indian shopkeeper and a young African man sparked days of tremendous brutality across Durban.

The National Party government had been elected less than a year before and had not yet had the opportunity to implement its plans to segregate the city. Blacks and Indians lived cheek by jowl in and around the docks and city centre, in hostels and the tightly packed lanes of shops, mosques and markets. They shared the streets, more or less peacefully.

There is so much about xenophobia today that compares with the pogroms that burnt Durban 70 years ago

But not that January, 70 years ago. Then, those parts of the personality most people strive to keep hidden were thrust into public. By the time the violence ebbed, almost 200 people had died and tens of thousands had been rendered homeless.

The scale of the recent xenophobic attacks in Gauteng obviously does not compare to that of 1949, nor do we approach those horrific numbers even when you combine the costs of all of the violence that has targeted so-called “foreign nationals” since first similar attacks began more than a decade ago.

But just as the fact that wars are no longer as deadly as they once were does not mean we have made much progress on the problem of enmity between nations, so too must we acknowledge that a lower body count does not mean we have made much progress on enmity within nations either.

Far from it. There is so much about xenophobia today that compares with the pogroms that burnt Durban 70 years ago. The scapegoating, the lines drawn between members of similar social strata within a single community, the almost giddy violence: it is all so familiar.

It is familiar to me as well because I am an American and know full well that there is nothing uniquely South African about such acts of violent hate. It has been only a month since an armed white man drove eight hours from Dallas to El Paso to kill those he thought alien, foreign, less human, more threatening and thus undeserving of life in the country he claimed for himself.

Mexicans are our Nigerians. Mass murder in a Texas Walmart was only the latest in a string of xenophobic, anti-immigrant paroxysms of rage that have plagued America since the US president began to add fuel to eager fires. At least in SA such xenophobic violence does not accord with expressed government policy.

LISTEN | What Police Minister General Bheki Cele plans to do about violent looting in Gauteng

Yet that twisted realisation ought not to provide any comfort, because the violence in Texas and Gauteng have too much in common with each other and with Durban in 1949.

Photographer and activist Omar Badsha was four years old that year. He lived in Douglas Lane, in a predominantly Indian neighbourhood, just over the railway line from the CBD. The violence that raged around his and his neighbours’ homes is one of his earliest memories. A brick came through the window; he remembers the glass all over the floor. His uncle and some other men took out their rifles to ensure things went no further than that.

Badsha now maintains SA’s most comprehensive history website, SA History Online. He clearly remembers how terrifying it was. The familiar world was turned upside down and revealed to be so much more precarious than he and so many others had thought.

In the years that followed 1949 South Africans who opposed apartheid organised under the considerable shadow of what had taken place in Durban. They reasoned that apartheid and the violence that had swept through that city were cousins; they accepted that the violent inscription and manifestation of difference is closer to human nature than most of us care to admit.

Living together takes work. Indeed, what makes humans remarkable is their ability to transcend that which comes easily, or naturally. The work done to maintain the idea of the nonracial, nonsectarian struggle against white supremacy, and for a more just SA, was a triumph over instinct. And it was just that — work, constant, dedicated labour, performed not only by those organisations that would propagate the freedom charter, but in different and seemingly opposing forms by later movements such as Pan Africanism and Black Consciousness.

It was work done, in time, over decades, by people who, like Badsha, had witnessed sectarian violence and insisted there was another way. There were so many Omars in 20th century SA: political leaders, exiles, prisoners, priests, parishioners, artists, union members, civic association activists, parents, gogos and students. Their motivations varied, yet most shared in common the conviction that human beings can transcend instinct and build societies.

For a long time it was assumed that the nation would incubate such transcendence as people from different backgrounds coalesced around the affection and esteem in which they were supposed to hold those with whom they shared space. Or at least this was the hope of the so-called national democratic revolution in SA, as it had been of so many nationalist movements during the 20th century. This hope has proved a chimera. By the 1980s the citizens of so many postcolonial African states knew how naive that was and by now SA and much of the rest of the world has wised up. We must now acknowledge that the nation is just as much a site of exclusion as it is anything else.

The paranoid, hate-filled, xenophobic, misogynistic, murderously vile face SA has shown to the world over the course of the last week looks little different to my own country’s vacant, deadly eyes. In the wake of such horror it is not surprising to see politicians and regular people cry, rend their garments and insist that “this is not who we are”. But I am not sure. I think maybe it is.

This violence is not unique to SA. What makes SA unique is that for so long so many of its people were invested in the idea that the diverse population of such a cosmopolitan, crowded, underresourced land could figure out a way to live together, to keep their demons in check, to wear the mask of civility and humanity, when it is undoubtedly simpler just to bare our fangs. To be sure, the facts of apartheid made this somewhat easier than it might otherwise have been. Hate and division on a national scale has usually generated a response over time (he writes, pleading that it might yet in America).

That said, it is essential that we remember there was nothing inevitable about the collective spirit that animated and sustained that decades-long struggle. It took the combined efforts of so many millions to do so; it took work to fill the time in between the protest marches, to pre-empt the bricks and the necklaces, not only to react in revulsion after the fact. It took millions of people who were convinced that theirs was a struggle against hate.

That struggle was not won in SA, nor was it won in my country. We are all implicated in that failure. We must admit that. Only then can we learn from the past how best to repair the masks we so desperately need in the present.

• Magaziner is a history professor, and director of undergraduate studies at the Council on African Studies, at Yale University. His latest book uses the life of Omar Badsha to narrate an intimate history of post-Second World War SA.