When former US president Barack Obama visited Johannesburg earlier this year, South African president Cyril Ramaphosa joked on stage that his guest fell short in only one department next to Nelson Mandela: dancing. But poor Obama never stood a fighting chance – most South African politicians dance at events, political rallies and even in parliament.

Around the world, we dance as an expression of love, desire and hope. Rhythmic or not, we move our bodies to music as a way of celebrating and showing joy at collective gatherings. But in South Africa, dance has gone beyond the world of happiness to become a political art form and a powerful tool for those who feel voiceless.

I have sharp childhood memories of how potently rage and a sense of injustice can be translated into dance. I was born in Johannesburg in the 1980s in the privilege of a white family, but I still remember the low sound of protest drums around the city and of feet hitting the pavement before the wail of police sirens would wake from their shallow sleep.

We moved to London during the height of apartheid violence in the late ‘80s. From our flat in Battersea, my parents would anxiously watch grainy images on BBC News of black South Africans in Soweto dancing with fury and jubilation in the face of heavily armed Afrikaans policemen and their slathering dogs.

I now know they were dancing the toyi-toyi. A rhythmic, stomping movement that elevated protest to something bewitching, the toyi-toyi has been credited with galvanising millions of black South Africans in the battle against apartheid. Disenfranchised and denied basic human rights by the white government, they took to the streets to fight against their oppression with one of the only weapons they had access to: their bodies.

During the Struggle, the toyi-toyi was a dance of unabashed provocation. As the South African jazz musician Hugh Masekela said, in reference to the state police, “Because we can’t beat these people physically, you can scare the shit out of them with our songs.”

The toyi-toyi, when it aims to intimidate, does just that. It is a collective dance that needs hundreds of participants to create a real sense of urgency, as each member of the crowd throws their knees up high and then stamps hard on the ground. Hands are raised above the head and each movement is accompanied by rhythmic chanting or singing. During apartheid, someone would usually cry ‘Amandla!’, meaning ‘power’, and the crowd would respond with ‘Awethu!’ – ‘to the people’.

Because we can’t beat these people physically, you can scare the shit out of them with our songs

“The toyi-toyi had a significant impact on the fight against apartheid,” said Dr Gavin Walker, an ethnomusicologist at Stellenbosch University. “It has become one of the most easily recognisable pieces of protest culture in the world – not just in terms of gestures and movements, but also rhythms.”

“The toyi-toyi entered South African collective consciousness when songs were changing from ones of lamentation and pathos in the 1970s to ones of anger,” he continued. “The arrival of the toyi-toyi coincided with the moment when the ANC [The African National Congress party that led the fight against apartheid and currently governs South Africa] started up their arms struggle, and the music reflected and helped push that change through. It makes me think of the Brecht quote – ‘Art is not a mirror held up to society, but a hammer with which to shape it’.”

The toyi-toyi may have helped sculpt modern South Africa, but it is believed to have been invented by Rhodesian freedom fighters in modern-day Zimbabwe. It soon spread like wildfire to non-militants and was deployed in weekly battles against the police in townships around the country.

“When the toyi-toyi crossed the border, it bled into the performance culture that surrounds these protests and quickly became as a way of intimidating the apartheid defence forces,” Dr Walker said.

“They [black South Africans] weren’t armed and were facing powerful weapons with nothing but music on their side, and they needed something to galvanise them. It soon became a powerful tool, partly because it is such a physically demanding exercise – you’re bringing your knees up high, and this releases adrenaline, while the rhythm of it creates an external pulse and powerful collective atmosphere, which staves off fear.”

The toyi-toyi is mesmerising to watch. A few weeks before my 10th birthday, we spent a month-long holiday at my grandparents’ house in a seaside town near Africa’s southernmost tip. One morning, I sat in my best-smocked dress and watched another grainy television. It was May 1994 and Nelson Mandela was addressing a crowd of thousands as the newly minted president of South Africa. As he spoke words of hope and love about his damaged country, the crowd in front of him began to dance. Hundreds of thousands of people in Johannesburg toyi-toyied to Madiba that day, and in response he danced right back at them on stage, jubilant under the spotlight of the world.

The toyi-toyi, that dance of intimidation and violence, had suddenly become an expression of celebration. As the country had undergone extraordinary change in the space of a few short months, the toyi-toyi’s meaning had transformed alongside it.

“I think the toyi-toyi is a dance of courage and unity,” said Themba Mbuli, a choreographer and dancer from Soweto. “It brought people together to fight for one cause when we were frightened, and this gave us the power of a group. But on that day in ’94, it also became a symbol of our unity as a country.”

Twenty-four years later and the toyi-toyi lives on in South Africa. It is performed at marches and celebrations, and the chants are used to release emotions of joy, pain, anger, encouragement, heartbreak and solace. Mass protests broke out last year against the corruption of then-president Jacob Zuma. Clutching banners emblazoned with the words ‘Zuma Must Fall’, South Africans of all races and ages danced down the streets, demanding accountability from their leaders.

As soon as you start to toyi-toyi there is this wonderful group camaraderie

My parents moved back to Cape Town a few years ago and now live on the foothills of Table Mountain. I was visiting them during last year’s protests and together we joined thousands of South Africans to call for the end of Zuma’s presidency. Unlike the dance-filled marches in Johannesburg and Durban, the Cape Town protests were a quieter affair. But towards the end of the day, the rhythmic sound of feet slapping the ground started up and the energy of the march shifted immediately as groups of people began to toyi-toyi down Parliament Street.

I can see how it could be intimidating in a different context. But on a sunny spring day, when the whole city felt like it was united in protest against corruption, the toyi-toyi was imbued with emotion and a sense of patriotism.

“As soon as you start to toyi-toyi there is this wonderful group camaraderie,” said Johannesburg-based dancer Georgina Thomson. “It’s about saying we’re not going to give up and we stand as a nation and are expressing our voice as a collective. It can feel quite celebratory.”

Today, the dance can be used to mark all of life’s milestones: people toyi-toyi at weddings, on birthdays, on voting and graduation days – and even during a particularly long queue at the post office. Visitors can see South Africans spontaneously start dancing on public holidays, particularly around Christmas and New Year. I have often sat on the Camps Bay strip in Cape Town and watched groups of young men toyi-toyi for fun outside the cafes and restaurants that line the picture-perfect beach. On the other end of the happiness scale, it is danced at funerals to express grief – on an unusually wet late-spring day in 2013, thousands of mourners toyi-toyied down the streets of Johannesburg during Mandela’s memorial service.

I have never been quite brave enough to join in the dance myself, but many ‘born-frees’ – those born after 1994 – have taken on the dance of their parents and grandparents. On politically charged university campuses, students of all ethnicities have toyi-toyied for lower fees and equal educational rights for all citizens.

If people aren’t happy with something and they dance on the street, the colour of your skin is irrelevant

“Some people say whites shouldn’t toyi-toyi because of the history of the dance, but I don’t agree,” Mbuli said. “It’s a unity dance that all South Africans know, with steps that anyone can do – dancer or not; young or old; white or black. For me, protest dance should never be about race. If people aren’t happy with something and they dance on the street, the colour of your skin is irrelevant.”

Unlike many southern African dances, the toyi-toyi isn’t linked to any single tribe and requires no prior dancing skills. Which is why, in a multi-lingual, multi-cultural country, the toyi-toyi has an almost magical ability to unite any crowd. South Africa is home an impressive 11 national languages; it seems apt that the toyi-toyi – that potent weapon against apartheid violence – is often referred to as the 12th.

The Customs That Bind Usis a series from BBC Travel that celebrates cultures around the world through the exploration of their distinctive traditions.