What a difference an election makes. Malaysia’s 14th general elections on Wednesday were understood by all observers to be a close-fought battle between the long-ruling Barisan Nasional regime, the Islamist Pan-Malaysian Islamic Party (PAS), and a new opposition coalition named Pakatan Harapan (Alliance of Hope) that united long-standing regime opponents with frustrated former insiders.

Some predicted a hung parliament in which PAS would play kingmaker, or a narrow Barisan Nasional victory. Almost no one was daring enough to predict the overwhelming victory of Pakatan Harapan, which took out 122 of 222 seats in parliament.

Although events are still unfolding – as I write this, Mahathir Mohamad is still waiting to be sworn in as Prime Minister – if Pakatan Harapan forms a government then Malaysia will have experienced a peaceful transition of power. For most scholars of democracy, this is the key indicator of democratisation: one incumbent government holds an election, loses, and steps aside as a result.

Such an outcome would make Malaysia in 2018 an almost paradigmatic case of “democratisation by elections”. This refers to a phenomenon of flawed and illiberal elections, as Malaysia’s have always been, producing democratisation by allowing oppositions a chance to challenge incumbent governments.

The outcome is not usually democratisation, but sometimes it is.

I have recently argued, with Lee Morgenbesser, that democratisation by elections is not a very useful framework for understanding democratisation in Southeast Asia. The simple fact is that Southeast Asia’s incumbent authoritarian regimes have long presided over elections, but they almost never step aside as a result.

When democratisation has taken place – in the Philippines in 1986, in Indonesia in 1999 – elections have represented the culmination rather than the cause of the transition.

Our argument devotes particular attention to the Malaysian case as a counterexample to democratisation by elections. If ever there was a country ripe for democratisation by elections, it would be Malaysia. The country’s political institutions function reasonably well by comparative standards, it has a robust political opposition and a vibrant online critical media, and other factors also augur well for elections to have democratising effects.

And yet Malaysia had held 13 general elections since independence, with no meaningful democratisation.

Indeed, elections in 1969 that yielded a surprisingly strong result for the opposition were followed by ethnic riots in Kuala Lumpur which in turn led to the suspension of Parliament and the formation of the Barisan Nasional regime in close to its current form (until the 1970s, it also included PAS).

In 1999, amid a massive economic crisis, the opposition coalesced for the first time in a pan-ethnic coalition, only to be defeated by a resurgent Barisan Nasional. The ruling United Malays National Organisation (UNMO), which has produced every prime minister in Malaysian history, has been able to steer the Barisan Nasional regime through these and other crises.

So what happened this time?

Analysts, academics, and activists will be rehashing the details for years to come, but there are a few immediate observations to make.

One is the black swan event of Mahathir Mohamad, former UMNO stalwart, coming out of retirement to challenge incumbent leader Najib Razak. Mahathir created a new party – the Malaysian United Indigenous Party, or Bersatu (meaning “united” or “as one”) – that challenged UMNO on its own turf for ethnic-Malay votes.

Another is PAS’s defection from the opposition, which resulted in a series of three-cornered fights between PAS, a Barisan Nasional candidate, and a Pakatan Harapan candidate. PAS’s departure also certainly made it easier for non-Malays and non-Muslims to vote for Pakatan Harapan, which no longer contained a party interested in implementing hudud, or punishments under Islamic criminal law.

Still another contributing factor is Najib himself, historically unpopular and beset by massive corruption scandals such as 1MDB.

Although corruption scandals are nothing new in Malaysian politics, this one proved particularly nagging. At a time in which many Malaysians perceive their economic situation to be deteriorating, the stories of profligate spending and financial misdeeds appear to have been especially damning.

It is tempting to argue that these factors, not the election itself, caused Malaysian democratisation (if, indeed, democratisation is what is occurring, which I must emphasise is not yet certain). Such a perspective would be consistent with my critical interpretation of democratisation by elections in Southeast Asia.

But I would argue that the key factor here really was the election itself: a surprise event in which Malaysians from across the country rejected the Barisan Nasional at the ballot box. The Barisan Nasional might have tried to halt the election had they known that this would be the result.

They did not stop it, Malaysians have spoken at the polls, and the results are clear. Now the country enters new and uncharted territory.