All parties in Egypt have overplayed their hands in the two and a half years since the fall of Hosni Mubarak in 2011. In the first months it was the army high command deceiving itself into believing it could marginalise those demanding radical democratic change. Then it was President Mohamed Morsi and the Muslim Brotherhood interpreting a narrow electoral victory as a mandate to rule alone. With the overthrow of Morsi by the army on 3 July and the massacre of Muslim Brotherhood followers on 14 August, the Egyptian army is gambling that it can win an outright victory and crush the Brotherhood, eliminating it permanently from Egyptian political life.

Too much blood has flowed for compromise to be feasible. Plausible suggestions made in early August about how the crisis might be brought under control now look out of date. Perhaps such hopes were always delusory: the army was never going to cede power back to Muslim Brotherhood leaders whom it had just put in jail, and those leaders were not going to legitimise a military coup against a legally elected government.

Just how far General Abdul-Fattah al-Sisi and the Egyptian army and security forces deliberately planned a massacre in order to rule out any future compromise is not clear. Probably the generals were not worried if they provoked a bloody confrontation. If ordinary peacetime politics are replaced by battles in the streets, guerrilla warfare or even civil war, then this merely reinforces the primacy of the armed forces and police. This process is already underway. General Sisi's civilian allies at the time of the 3 July coup are being discarded, ignored or, like former head of the International Atomic Energy Authority and Nobel Prize winner Mohamed ElBaradei, have resigned in protest. With 10 retired generals and two police commanders from the Mubarak era being appointed provincial governors, Egypt is effectively under military rule.

Download the new Independent Premium app Sharing the full story, not just the headlines

Many predictions of the experts about the trajectory of Egyptian politics since the start of 2011 have been falsified by events. This is not entirely the experts' fault. I have always thought that if I can forecast a military coup in Egypt or in any other country then so can the head of the secret police and he will do something to avert it (unless, of course, he is leading the coup himself). As a result, history favours the unforeseen, and appears more accidental than it really is.

There is a further reason why the predictions of experts are frequently wrong. Their vision of the future is often determined or over-influenced by the assumption that protagonists will act in their own best interests. But again and again – be it Soviet Communist Party officials in the 1980s, Saddam Hussein in 1990-91 or Egyptian leaders in 2011-13 – those in charge opt for self-destructive moves with disastrous consequences for themselves. Right up to the giant rallies in Egypt on 30 June Morsi believed the mass petition against his rule was "absurd and unconstitutional". He convinced himself, against compelling evidence to the contrary, that the Egyptian armed forces had accepted a subsidiary role so long as their interests were protected. By policies of sustained ineptitude Morsi and the Brotherhood forced together a strange and awkward alliance against themselves of officials from Mubarak's police state, the military establishment, anti-Mubarak leftists and liberals, businessmen, Copts, intelligentsia and even Salafists.

Of course, this bizarre alliance could not last and no doubt many members of it saw this clearly. It was reasonable enough for the Copts to conclude that they were safer under a military regime than they would be under Morsi and the Brotherhood. Businessmen might yearn for stability and enormous subsidies – $12bn from Saudi Arabia, UAE and Kuwait – under a post-Morsi authoritarian government. As for those liberals, leftists and intelligentsia who imagined that the army and security forces were going to share power with others, it is worth recalling Lenin's contemptuous dismissal of a suggestion that he share power with political opponents. He said that the person who gave the advice showed "a sweet naivety which would be touching in a child but is repulsive in a person who has not yet been certified as feeble-minded."

Morsi and the Muslim Brotherhood are presumably not great readers of Lenin, but if they had been, they would have had a better idea of the realities of taking and holding power. Instead, they took the contradictory position of seeking to make revolutionary changes in who ruled Egypt, while at the same time expecting their opponents to be restrained by the letter of the law and a controversial constitution. The Brotherhood's rhetoric was radical enough to frighten opponents without diminishing their power to act. Its leaders now complain that it is unfair to blame them for failing to tackle Egypt's appalling economic and social problems such as mass poverty, unemployment and inflation because the civil service was virtually on strike from the moment Morsi became president. This is undoubtedly true but the non-cooperation of the bureaucracy and the security services should have been a hint to the Brotherhood of the real weakness of their position.

The generals are now closing in for the kill in every sense of the phrase. The Brotherhood are demonised as "terrorists" who must be exterminated. Propaganda on state-run media is as hate-filled and mendacious as anything on Baghdad television during Saddam's bloody campaigns against Shia and Kurdish insurgents. A few Brotherhood supporters may have guns but most are demonstrably peaceful and unarmed, as is illustrated by the casualty figures. Even so, as corpses accumulate in the mosques, the Foreign Ministry spokesman Bader Abdel Atty claimed the demonstrators "are raising al-Qa'ida flags in the heart of Cairo. They are using machine guns against civilians."

In other words, there is going to be a fight to the finish with both sides believing the other has bitten off more than it can chew. The army and security forces control most of the instruments of power and are very unlikely to lose, but can they emerge as an outright and conclusive winner? For all their expressions of dismay at last week's bloodbath, the US and the EU states were so mute and mealy-mouthed about criticising the 3 July coup as to make clear that they prefer the military to the Brotherhood. Given that 500 Egyptian military officers a year – including General Sisi and the air force head General Reda Mahmoud – train in the US they will be well-attuned to what America wants or will accept.

Unsurprisingly, generals and security men prescribe military solutions for political problems. And, if force at first fails, they are likely to see this as a reason to use more force rather than seek compromise. This is a lesson of the Turkish military coup in 1980 in which hundreds of thousands were jailed and tortured, and likewise of the Algerian military takeover in 1992, designed to avoid an election victory by an Islamic party. Military dictatorships often succeed by their own lights, but at horrendous cost to the societies they are supposedly trying to protect. Egyptians will be lucky if they are not at the start of a new dark age of military repression.