I'm not sure if it's a good example to refer to Egypt. Not sure if the people there have gained so much with the new regimes, that life is so much better there than during Mubarak's regime.
I'm not referring to Mubarak. I'm referring to the Muslim brotherhood and Mohamed Morsi -- which was the only military coup in Egypt during all of their civil unrest.
The example is a perfect example. In Egypt, the military has always had the final say. They are the "protectors of secularism" so to say. The "dictators" of Egypt such as Nasser and Sadat protected secularism, protected minorities, kept Islamists at bay, enforced peace, and otherwise we're just nationalists engaged in politics across the world. They were supported by the military.
The issue is that at times, especially right now, Islamism is a clear majority. That area of the world is notorious for bribery, rigging, and fixed elections. Democracy, there, is highly undemocratic. And even so, what it elects is not a free world. What it elects destroys democracy by oppression, intimidation, and reform. It brings back the same dictatorships installed by the militaries, in opposition.
Why do you think when the Muslim brotherhood was re-exiled from Egypt, Turkey gave its members safe haven? Because Erdogan and his party promote those values. Erdogan and the Turkish government won't recognize El Sisi in Egypt as its leader still to this point, and demand Morsi is released from prison.
Anyways. Turkey's military is the "protector of secularism" much like in Egypt. This coup is damn near the exact same thing as removing Morsi from power. Secularism is the law of the land in Turkey, and the military is tasked with defending secularism. Erdogan historically has been part of several political parities that have been outlawed on that note, only to resurface under a new name. He is known to have ties to questionable radical clerics. He is an Islamist in all things but official namesake, and the military taking action in Turkey is nearly the exact same thing as it was in Egypt when Morsi was deposed.