The Red Ants are a South African private security company specialising in clearing “illegal invaders” from properties. Two, sometimes three times a week, a convoy of trucks drives out of the gates of a sprawling farm in Gauteng province, carrying hundreds of men and led by “officers” armed with shotguns and handguns.

The company is rarely out of the headlines in South Africa and has been repeatedly accused of crimes ranging from theft to murder. It is fiercely criticised by human rights campaigners. But the attitude of the general public is more ambivalent – and the Red Ants themselves are fiercely loyal to each other and their employers. “We are a family. We look after each other … We have built a community,” says Johan Bosch, the farmer who founded and owns the company.

Johannesburg’s crumbling buildings

A lack of adequate housing is one of the most toxic legacies of the apartheid regime that governed South Africa for nearly 50 years. Families, migrant workers, students and homeless people pay middlemen for plots on wasteland around Pretoria and Johannesburg or in derelict buildings in the cities’ centres. Local authorities show little sympathy and say they have to enforce the law. Their chosen enforcers are the police and, to provide the manpower for evictions, the Red Ants.

Fattis Mansions was once a fashionable 1930s block of flats in the heart of the banking and legal district in Johannesburg. Wealthy, mainly white, residents fled Johannesburg’s centre during the late 1980s and early 1990s, leaving hundreds of buildings to be taken over by poor migrants from rural areas. Four hundred people shared three taps. There were no toilets or electricity. The city authorities have been clearing these “hijacked buildings” one at a time for years – often using the Red Ants.

The operation, involving 600 Red Ants, begins in the early morning, without warning. Wailing police sirens fill narrow streets. The Red Ants pour through an entrance, then proceed on rusting iron stairways and down filthy corridors. There is no resistance. The pushers, gang leaders and the rent extorters have gone. Rubbish, furniture, mattresses pile on the roadway outside.

The singing starts, low and purposeful, as the Red Ants work. Children are carried out, followed by distressed mothers clutching salvaged belongings in plastic bags. Most adults knew this would happen one day. For those too young to understand, the sky has fallen in.

Who are the men in the red overalls? They come from impoverished small former mining towns, from distant provincial villages in parched mountains, from Soweto, from hardscrabble neighbourhoods half hidden amid the urban sprawl of Johannesburg. Most are young. Many are without basic educational qualifications. Some have criminal records. A few are former convicts. All are poor. They are paid the equivalent of $10 (£7.50) a day, plus some food. Many are squatters themselves.

One left neighbouring Mozambique to work on building sites but has struggled to find employment. “My wife said get a job … so I did,” he says, shrugging narrow shoulders. Another says he has siblings to feed and clothe and send to school: “No one likes doing this … But I go to church every Sunday and pray for my soul and I know my Lord is watching over me, even here.” All say they feel sorry for the squatters but “work is work”.

In charge are older men whose own life stories are intimately intertwined with the complex, troubled history of their nation. One fought in the 80s in the South African defence forces in cold war battles in Angola. Another, a former police officer from Soweto whose family was deeply involved in the struggle against apartheid, say his career ended when he denounced corruption. He says his work reminds him of his time in the police. He now suffers from chronic insomnia.

Demolishing shack settlements

First you see the smoke, above the dry hills and the scattered corrugated iron homes. Then you hear the noise. If the operation is going well, it is that of a work site: hammers rhythmically striking metal, straining diesel engines, work songs, radios, and shouted orders. If the operation is going badly, the noise is of a battle: shattering glass, rocks striking plastic shields, stamping feet, shots, sirens and screamed abuse.

Sikhumbuzo Dlamini, a Red Ant leader, watches 650 men, equipped with crowbars and shields, and all dressed in identical red overalls and helmets, move through an illegal squatter camp on the ragged outskirts of Pretoria, the administrative capital of South Africa. “We always win. We have to win … we are on enemy territory. We are a long way from home,” Dlamini says.

One incident prompts a slew of new allegations. The Red Ants are hired to clear squatters from land where a shopping complex is due to be built in Lanesia, on the southern outskirts of Johannesburg. The operation starts in the early morning. But the squatters are ready and fight the Red Ants with machetes, rocks and staves.

The eviction stalls and the Red Ants withdraw. Two squatters lie on the ground. One is dying from head injuries, the other is dead. Under a tree, huddled in a plastic chair salvaged from her makeshift hut, a widow sobs. The violence prompts investigation by private security industry regulators. The Red Ants deny wrongdoing.

Losing one of their own

Red Ants are injured, sometimes even killed. Kervin Woods died when land invaders opened fire in Lenasia South. The Red Ants said community members stabbed him, some using screwdrivers, after he fell to the ground. Preparations were made to set fire to his body when Red Ants started shooting, dispersing the crowd.

Woods’s funeral takes place in Soweto. The dead man’s aunt weeps, comforted by a handful of family members and neighbours. But this is primarily a Red Ants funeral. Senior leaders salute the coffin and deliver short eulogies before the rank and file sing hymns as the coffin is closed. Then, as a guard of honour, they follow a hearse to a cemetery where they sing as each takes a turn with a shovel to pour dry soil into the grave.

Handguns and shotguns are fired into the air in a final salute before the Red Ants return to their buses and their base for a memorial meal. Within days, they are out on another clearance operation.

South Africa is a fractured land. It is optimistically known as the Rainbow Nation, a reference to the diversity of its communities. But in a rainbow, the colours remain separate. The most striking divide in South Africa is economic. The Red Ants are on the frontlines of a conflict between those with land and those without, the haves and the have-nots, the winners and the losers in one of the most unequal countries in the world. During their 12-hour days, they are on one side. But when their work is done, they return to the other.