That seems to be the main lesson from three days of political chaos in Malaysia, as the 94-year-old Mahathir Mohamad managed to resign both the premiership and leadership of his party, but keep both jobs , and have accusations of betrayal turn into pledges of loyalty and support from all sides of the parliamentary divide.

How did we get here? The answer to that involves a decades-long rivalry, accusations of backstabbing, a mess of acronyms and Malaysia's sometimes fraught religious and ethnic divides.

Malaysia's Prime Minister Mahathir Mohamad waves after he was granted an audience with King Sultan Abdullah Sultan Ahmad Shah at the National Palace in Kuala Lumpur, on Monday, Feb. 24, 2020.

Political crisis

After louder and louder rumblings of internal turmoil, the ruling Pakatan Harapan (PH) coalition abruptly collapsed Monday amid accusations several high-profile members, led by Mahathir, were negotiating with the United Malays National Organization (UMNO) to form a new government.

That coalition was led by Mahathir, a one-time UMNO leader and prime minister, who joined the opposition in order to bring down Najib, who he regarded as massively corrupt. Najib is currently on trial over numerous charges relating to the 1MDB scandal, which he denies.

While some members of PH were suspicious of Mahathir's motivations, his star power and ability to appeal to traditional UMNO supporters undeniably helped in their ultimate victory. He subsequently became prime minister under an agreement that he would eventually hand over power to fellow PH leader Anwar Ibrahim.

It was that transition that appeared to be in doubt this week, yet another wrinkle in the decades-long saga that is Anwar and Mahathir.

Anwar was once the older man's heir apparent, until he was fired by then-Prime Minister Mahathir in 1998, and charged with corruption and sodomy. He would spend much of the next two decades in and out of prison, as first Mahathir and then Najib brought more prosecutions against him.

In 2018, with more and more revelations about Najib's alleged crimes emerging and public clamor for his removal growing, Mahathir formed a breakaway party of former UMNO members, Bersatu, and joined the PH coalition.

Anwar's wife, Wan Azizah Wan Ismail, endorsed Mahathir and served as his deputy. Following their victory, Anwar received a royal pardon that allowed him to enter politics again. He was elected to parliament in October 2018 , clearing him to assume the premiership.

Despite suspicions that Mahathir might backtrack on this deal, given his long and not-exactly-collegial history with Anwar, many of his critics were reassured by his statements that he saw himself more like a temporary caretaker , helping the government get back on track. After all, when he assumed office at 92, Mahathir became the world's oldest leader, how long could he really expect to stay in power?

Supporters of Mahathir Mohamad, chairman of Pakatan Harapan (The Alliance of Hope), wait for Mohamed to be sworn in as Malaysian prime minister, outside the National Palace 'Istana Negara' on May 10, 2018 in Kuala Lumpur, Malaysia.

Kingmaker

As Mahathir showed this week, however, his age has not dented in the slightest his political wiliness and ability to play all sides at once.

The latest crisis appears to have arisen from within Anwar's People's Justice Party (PKR) and the perpetual prime minister in waiting's own interpersonal relationships, or lack thereof, with his main rivals. Writing Monday , Malaysian politics analyst Bridget Welsh said that "divisions over leadership, racial politics and reform had split the (PH) coalition for some time."

"The more Anwar Ibrahim pushed for a date of the transition, the more the forces opposed to his leadership worked to consolidate an alternative," she said.

Following a weekend of frantic closed-door meetings between all sides, Anwar came out in support of Mahathir on Monday, blaming the attempted political coup on a PKR faction led by deputy leader Azmin Ali, who he promptly sacked.

"Those from my party and outside are using his name. He reiterated what he said to me earlier. He had no part in it. He made it very clear in no way would he work with those in the past regime," Anwar told reporters Monday.

Another top PH leader, Lim Guan Eng, also voiced his support of Mahathir and condemnation of Azmin and other PKR defectors, who he said were attempting "to form a back-door government to replace the existing democratically-elected PH government with a new coalition."

"In objecting to this nefarious attempt to subvert and undermine the people's mandate given to PH, Tun Dr Mahathir Mohamad had submitted his resignation as Prime Minister," Lim said in a statement posted online, adding that his Democratic Action Party (DAP) would support Mahathir remaining as premier.

Indeed, that seems to be the one thing everyone agrees upon. In a statement widely reported by Malaysian and regional media, Azmin and 10 other former PKR lawmakers accused Anwar and his allies of being the "real traitors," attempting to force Mahathir into a lame-duck situation.

"Last Friday, we saw an attempt by some of PH top leaders forcing the prime minister to set a date to resign and proceed with the transition of power to PKR president Datuk Seri Anwar Ibrahim," the statement said. "The campaign, which started a few months ago, has gained momentum to divert the people's attention from efforts to restore the country's economy and make institutional reforms."

Najib Razak, outgoing Prime Minister of Barisan Nasional party speaks during a press conference following the 14th general election on May 10, 2018 in Kuala Lumpur, Malaysia.

Ethnic strife

If a new political realignment does emerge from the chaos of this week, it is likely to be of a very different flavor to the Pakatan Harapan coalition.

When that grouping came to power, it was the first time in the country's post-independence history that the dominant parties in government were multiethnic ones. The new cabinet also included numerous Chinese and Indian Malaysians in prominent positions. While PH was hailed by many observers as more representative of Malaysia's ethnic makeup, its mix of parties made it vulnerable, with several, including Mahathir's own Bersatu having Malay-first leanings which led to tensions within the PH alliance.

In Malaysia, over 60% of the country's 32 million population belong to the Bumiputera -- a group known as "sons of the soil," which includes ethnic Malays, and natives of Sarawak and Sabah in Borneo. At 21%, Chinese Malaysians make up the country's next largest ethnic group, followed by Indian Malaysians at 6%.

The potential members of a new coalition are primarily Bumiputera parties, similar to the Barisan Nasional (BN) coalition helmed by former UMNO leader and prime minister Najib Razak.

Najib himself oversaw a strongly Malay-first administration and increase in racialized politics, a strategy he has doubled down on in opposition, while he awaits his various trials for corruption. Many observers believe this strategy to be the driving force behind UMNO's alliance with the Malaysian Islamic Party (PAS), a former rival.

The presence of PAS in any potential new coalition, as well as the almost entirely monoethnic makeup of it, will alarm many urban Malaysians and ethnic minorities, and would be a major step back from the post-racial political transformation some were hailing in 2018.

Nor is there any guarantee that such a monoethnic coalition would actually be any more stable than its predecessor.