Tensions between Turkey’s Islamist-based government and its secular military establishment came to a head on Friday when the country’s four most senior commanders — the chief of the general staff and the heads of the three services — resigned together in protest against the trial of several senior officers for allegedly plotting a coup.

The allegations and counter-allegations about the alleged coup plan, “operation sledgehammer”, have been going on for some years now. The BBC’s Jonathan Head last year described it as “a string of alleged plots and conspiracies so twisted and murky that the term ‘Byzantine’ scarcely does them justice.”

There’s certainly nothing implausible about the idea that the military would have plotted against the government of Recep Tayyip Erdogan and his Justice and Development Party. Turkey’s army has a history of meddling in politics, having staged several coups in the past. Most recently there was a “soft coup” in 1997, when the previous Islamist government was forced from office under military pressure.

So it’s understandable that Erdogan sees the military as a threat, and that he and his allies have seized on the allegations to discredit it.

It’s also possible that some of the arrests have actually been preventative in nature, and some of the officers are in jail not for having plotted a coup in the past, but because they are seen to be at risk of plotting one in the future.

On the other hand, the military’s self-image as guardians of democracy is not totally fanciful. There is no history of generals trying to take power for themselves, and each coup has been followed by a reasonably smooth transition back to civilian government. On at least some occasions the generals have probably left the democratic system better than they found it.

But now the military’s power is on the wane, and this time the generals seem to be acting from weakness rather than from strength. Erdogan’s government promptly accepted the resignations and a new army chief was quickly appointed.

It’s hard to imagine an Australian government ever being so cavalier about a threatened resignation from its top brass; our politicians are used to giving the military pretty much whatever they want. But fortunately we have no history of having to worry about such things.

Turkey’s politicians, with very different experience, know that they have to hold the line.

What’s most striking about Friday’s events is how little anyone seems to be worried by them. While terms such as “unprecedented” are (rightly) being thrown around, there seems no serious suggestion that this will be the signal for a coup. As The New York Times put it, the news “left many people wondering whether they were witnessing the end of the power the military has long exercised over the nation’s political system”.

The threat to Turkish democracy may be elsewhere: that Erdogan will now feel less constrained, particularly since his political opponents look like discrediting themselves by support for the military and will be more likely to indulge his own authoritarian impulses.

But a military that stays out of politics is an essential precondition for a democratic Turkey. Under Erdogan’s government, Turkey has made major strides in economic growth, human rights and national self-confidence; it appears more and more as a model for the region, while still hoping for eventual membership in the European Union.

It looks as if no one wants to imperil that for the sake of a few rogue officers.