'Rwanda is our nightmare, South Africa is our dream," wrote the Nigerian author Wole Soyinka, reflecting on the events of April 1994 – the most momentous month in Africa's post-independence history. Even as South Africans formed endless human chains to vote for Nelson Mandela as their first black president and bury racial apartheid under euphoria, hundreds of thousands of people were being murdered in a tiny east African country away from the the global gaze.

Twenty years on from these twin eruptions, South Africa remains a template of reconciliation studied everywhere from Northern Ireland to Palestine, but the Rwandan genocide can be seen as a fork in the road not just for Africa but the world.

That searing experience continues to shape the thinking of a generation of policymakers and peacemakers anxious that there should not be "another Rwanda" on their watch. It is a constant spectre when global powers debate the morality of intervention – whether in Afghanistan, Iraq, Libya, Mali, Syria, the Central African Republic (CAR) or Ukraine.

"No serious international lawyer has applauded the US's failure to act in Rwanda," Mia Swart, a professor of international law at the University of Johannesburg, wrote in South Africa's Business Day newspaper

"Syria should not be another Rwanda."Along with that other 1990s catastrophe in Bosnia, the killing of 800,000 Tutsis by Hutu extremists in Rwanda over 100 days was a signal failure of UN peacekeeping. UN military commander Roméo Dallaire had warned of impending massacres three months earlier but was ignored by the security council. Kofi Annan, then head of UN peacekeeping, writes in his memoir: "We spent days frantically lobbying more than 100 governments. I called dozens myself … We did not receive a single serious offer. It was one of the most shocking and deeply formative experiences of my entire career."

Scarred by memories of Vietnam and Somalia, the US government did not publicly use the word genocide until 25 May and even then diluted its impact by saying "acts of genocide". Bill Clinton, who was president at the time, has since described it as "my personal failure".

In his millennium report of 2000, Annan, then UN secretary-general, laid down a challenge: "If humanitarian intervention is, indeed, an unacceptable assault on sovereignty, how should we respond to a Rwanda, to a Srebrenica, to gross and systematic violation of human rights that offend every precept of our common humanity?"

The result five years later was a UN doctrine, Responsibility to Protect (R2P), adopted as a "norm" for dealing with conflicts where civilians were under attack. It was invoked in the deployment of peacekeeping troops to Darfur a year later and has since been referenced in UN debates on Libya, Ivory Coast, South Sudan, Yemen, Syria and the CAR. But whereas the 1990s had brought Rwanda and Bosnia, the 2000s delivered a counter-weight in the form of Afghanistan and Iraq, both widely condemned as blundering adventures that exemplified the law of unintended consequences. Annan was an outspoken critic of the US decision to topple Saddam Hussein. Some analysts argued that, in effect, it cancelled out Rwanda when it comes to weighing the balance of intervention. "People are outraged but it is on paper and when it comes to the practicalities they don't want to move quickly, for example in Syria," said Koffi Kouakou, a foreign policy expert at Wits University in Johannesburg.

"The executions of the UN's resolutions has not been vigorous. If it was not for France in Mali or the CAR, we would have had a genocide."

Such examples illustrate how every case has specific dynamics and demand for pragmatism. In their book, Can Intervention Work?, Rory Stewart and Gerald Knaus write: "We both believe that it is possible to walk the tightrope between the horrors of over-intervention and non-intervention; that there is still a possibility of avoiding the horrors not only of Iraq but also of Rwanda."

The biggest UN intervention of all has come in Rwanda's giant neighbour, the Democratic Republic of the Congo, where genocide has its most lethal legacy: millions have died in subsequent wars and clashes between rebel groups. The presence of Hutu extremists who fled Rwanda when the tide turned against them is cited by president Paul Kagame's government as justification for its continued interference.

A post-1994 outpouring of western guilt has, many argue, allowed Kagame to escape criticism for running an authoritarian regime that ruthlessly crushes dissent, including the alleged assassination of opponents abroad.Clinton has described him "one of the greatest leaders of our time", Tony Blair called him a "visionary leader" and former international development secretary Clare Short infamously said of him: "Such a sweetie."

Kagame, a bush fighter turned strongman leader, is a worrying role model who risks legitimising autocrats in other counties, according to Kouakou. "He is one of those ex-rebels who graduated to power through a process of 'legal systems', as we also see in Uganda and South Sudan. But the remnants of the rebels are still there: they still carry with them that authoritarian or 'big man' tendency."

It is one reflection of how, as each prepares 20th anniversary commemorations, Rwanda and South Africa have taken divergent paths. One is among the fastest-growing economies in the world but lacking in basic political and media freedoms. The other is its inverted mirror: a robust constitutional democracy with a vibrant press, already on its fourth president, but economically stagnant and among the most unequal societies on the planet.

Soyinka's dichotomy of dreams and nightmares continues to resonate in Africa and beyond