Usually it takes a scandal or a massive policy blunder to force a sitting head of government to resign. But Thursday morning, Turkish Prime Minister Ahmet Davutoğlu announced that he'd be leaving his job on May 22 — without a scandal or policy blunder in sight.

Instead, Turkey's president, Recep Tayyip Erdoğan, forced Davutoğlu from his job. On paper, this is strange: Turkey has a parliamentary democracy, so the prime minister, not the president, is supposed to actually run the government. But it's long been clear that Erdoğan has actually been calling the shots, with Davutoğlu serving mostly as his sidekick.

This is a grim development for Turkish democracy. Davutoğlu was forced out because he couldn't get on board with Erdoğan's plan to revamp the Turkish constitution to concentrate a dangerous amount of power in the office of the presidency. Davutoğlu's ouster is a clear signal that Erdoğan is about to proceed with his plans to seize power.

The scariest part? He might actually succeed.

The decline and fall of the Davutoglu-Erdogan bromance

To understand why Davutoğlu's ouster is so epochal, you need to understand a little about the history of the two leaders. For one thing, Erdoğan was actually prime minister for the decade before Davutoğlu took the job.

The Justice and Development Party (AKP), from which they both hail, won its first national elections in 2002. The victory, fueled by domestic economic problems, elevated party leader Erdoğan to the premiership, which he assumed in 2003.

Erdoğan tapped Davutoğlu, then an academic, to be his foreign policy adviser, ultimately appointing him foreign minister in 2009. Together, they crafted Turkey's response to the Iraq War and then the Arab Spring, developing a close working relationship. But it was always clear that in the relationship, Erdoğan was in the driver's seat.

So when Erdoğan was term-limited out of the prime ministership in 2014, Davutoğlu was a natural choice to replace him. Erdoğan thought he could maintain control of the government by appointing a stooge to be his prime minister, and took steps to make sure it would work that way — including some that were possibly unconstitutional.

"When Erdoğan ascended to the presidency, the Turkish constitution required him to officially resign from the AKP and to have no involvement in the party’s political affairs," Michael Koplow, policy director at the Israel Policy Forum and an expert on Turkey, writes.

"Erdoğan then proceeded to blatantly campaign for the AKP on multiple occasions with appeals to voters that only a vote for the AKP would ensure stability and a new constitution," Koplow continues. "The makeup of the current cabinet ostensibly selected by Davutoğlu following the November election, and which is supposed to have nothing at all to do with the president, has Erdoğan’s fingerprints all over it and includes numerous Erdoğan loyalists and his son-in-law."

On the rare occasions that Davutoğlu tried assert some independent control over policy — which made sense, given that he was constitutionally in charge of it — Erdoğan wouldn't have any of it.

"Tension began with differing legislative priorities," Aaron Stein, a senior fellow at the Atlantic Council who studies Turkey, told me. The first flashpoint, Stein said, was a multimillion-dollar corruption scandal involving the minister of the interior, which went public several months before Davutoğlu become prime minister.

"Davutoğlu favored the passing of a transparency package that would seek to address this, at least in the eyes of the public," Stein explains. "Erdoğan vetoed that."

The two disagreed on a handful of issues throughout Davutoğlu's tenure. For example, Davutoğlu favored a more conciliatory stance to the PKK, a Kurdish militant group in Turkey's southeast, than Erdoğan was comfortable with. But in the PKK situation, and more generally when the two disagreed, Erdoğan's preferences generally won out. Erdoğan had far more institutional support inside the AKP, making it difficult for Davutoğlu to cross him without losing his job.

"Davutoğlu will be remembered in history as someone who took the job of prime minister at a very difficult time — and, arguably, tried to do his best within extremely complicated constraints," Mustafa Akyol, a prominent Turkish journalist, writes in Al-Monitor.

Erdoğan wanted a puppet, and Davutoğlu didn't totally play along. "When you expect total acquiescence and you only get mostly acquiescence, heads roll," Koplow writes.

Davutoglu is out because presidentialism is in

The biggest disagreement between the two men, and the one that ultimately forced them apart, is Erdoğan's plan to transform the Turkish constitution.

"As they moved forward, it was really about the presidential system coming to the fore," Stein says.

Erdoğan wants to rewrite Turkey's constitution, turning it from a hybrid presidential-parliamentary system, where the prime minister generally rules, to something more like the American system, where the president controls the executive branch.

That may not sound bad abstractly. But Erdoğan has behaved in an increasingly authoritarian fashion in recent years — cracking down on dissident journalists, violently breaking up mass anti-government demonstrations, and frequently shutting down access to social media sites like Twitter and YouTube. Though the details of his constitutional plan are not yet public, the widespread understanding in Turkey is that any Erdoğan-supported plan would concentrate truly dangerous amounts of power in the presidency.

"The leaks about it have suggested that the checks and balances are lacking, and that it will concentrate power basically in Erdoğan's hands," Stein says.

Erdoğan has made no secret of his presidential ambitions. In June 2015, Turkey held an election that was widely perceived as a referendum on Erdoğan's ideas. The AKP suffered its most significant defeat since taking power in 2015, temporarily costing the party its majority in Parliament (it won back the majority in special November elections).

Today, things are very different. Turkey's opposition is, for various reasons, in total disarray. Erdoğan could theoretically call early elections in the not-so-distant future, which, given the state of the opposition, could result in a large enough parliamentary majority for the AKP to amend the constitution. His chance of actually getting what he wants is shockingly high.

"It's better than any chance in history. I'd say it's over 50 percent," Stein says.

According to Stein, the first step will be to present a draft constitution, likely to happen around June. Since Davutoğlu opposes presidentialism, Erdogan wanted to replace him with someone more pliable — preferably before June.

Getting rid of the prime minister, then, is essentially Erdoğan's declaration of war on Turkey's current constitutional order.

"The absolute loser in all of this is not one newly unemployed individual, but the institutions and political culture of the Turkish state," Koplow concludes.

What happens in Turkey really matters

The stakes here are high, given how alarming Turkey's drift toward authoritarianism already is. "Erdoğan is well on his way to becoming a dictator, if he isn’t one already," Dexter Filkins, the New Yorker's longtime Middle East correspondent, wrote in March.

A shift to presidentialism would consolidate power in the hands of a man who has demonstrated a consistent pattern of abusing it. There is a nontrivial chance that such a shift would be a fatal blow to Turkish democracy.

"I shudder to think what would happen if there was constitutional change," Koplow told me last year.

This would have terrible consequences for the Turkish people, first and foremost. But it would also show the rest of the world something scary: Democracy isn't as safe as we might think it is.

Turkey is a fairly wealthy country by global standards, with a GDP per capita of $10,421. Political scientists have thought for years that democracies that achieve this level of wealth don't backslide into authoritarianism.

"Wealthy democracies don’t become dictatorships. For a generation that adage has provided one of the firmest laws of modern democratization," Jason Brownlee, a professor of government at the University of Texas Austin, writes in the Washington Post.

A democratic collapse in Turkey would be the first obvious case to break this pattern. It would suggest that what was previously seen as a law might just have been an accident of history. Democracy might not be as safe as we think, even in wealthy countries.

"Authoritarianism in Turkey," Brownlee writes, "would cast a pall over other high-income countries where democracy seems assured."

So the battle over Turkish democracy, kicked off in earnest by Davutoğlu's departure, doesn't only matter for Turkey. It raises questions about a fundamental building block on which our modern world is built: the stability of democratic governments.