ELI5:How exactly does a military coup work?

This post explained coups a lot better then I ever could

http://np.reddit.com/r/history/comments/35jee9/what_strategies_have_violent_regimes_and/cr5ewgm

Relevant portion:

Part 1: Why Coups Occur

So first things first, what is the number one concern of the 'modern' (meaning effectively 19th-century onwards) dictator, autocrat, or general generalissimo in terms of securing his power? Is it the righteous revolution of his oppressed masses? No way, hippie, that shit's Hollywood. It's the coup. More specifically, the military coup. The coup should be differentiated from the revolution in that a revolution is the wholesale supplantment of the social-political mechanisms of power, whereas a coup is merely about seizing those mechanisms. In other words, a coup is about seizing Parliament and Palace and using those levers of power to your ends.

Now, why is the military coup such a major concern? Well, for one thing, they are shockingly common amongst undeveloped and underdeveloped states, and far more common than civil wars or revolutions. From 1950-2010, there have been 457 attempted coups. 227 were successful (roughly 50 percent). 94 countries have experienced at least one coup attempt. In some parts of the world, coups occur more often than democratic transfers of power. You shakin' in your boots yet, Mr. Dictator? How you gonna safeguard your power in this situation?

Well, it gets worse. Consider the following: your loyal military - it may not be so loyal. Indeed, it's probably the most likely group to stab you in the back. Why, you may ask? Well, dictators and communists share more than one thing in common, and this is one of them: it's all the Industrial Revolution's fault. Well, more specifically, it's division of labor's fault. In the 19th century, there was a sea change in how militaries are organized and trained, and this changed this is how they conceptualize themselves and their role in society. In short, a state's officer corps changed from being either a mercenary rentier or a collection of privileged amateur gentleman nobles to being a "functionally specialized and educated creature," that, like a doctor or lawyer, is differentiated from the rest of society (and, crucially, self-differentiates) on the basis of his skills and talents and function. This is called the "Professionalization of the Military," and what's important about this is that modern militaries have essentially become a corporate body unto themselves, with their own bureaucratic interests, their own social/political preferences, and their own conception of the national interest. (Reading List: The Soldier and the State by Samuel Huntington; The Professional Soldier by Morris Janowitz)

So we have the military, a well-organized, hierarchical, disciplined corporate body, with its own bureaucratic interests and its own conception of the national interest. This is extra scary for dictators for an obvious reason: the military has all the fucking guns! Now, that's all fine and dandy in the bourgeois advanced-industrial Western state, where the standard of civilian control is rock solid, but much, much scarier in places where the military has more disposition to intervene aggressively in politics. Let's look at some of the reasons that militaries are motivated to intervene: (Reading List: The Man on Horseback by Samuel Finer; Coup d'etat, A Practical Guide by Edward Luttwak)

Manifest Destiny - Unique identification with the national interest, specially well-placed to plead so in the case of an incompetent or hazardous regime. Can view itself as a 'caretaker' in the face of civilian incompetence. (Turkey, Thailand)
National Interest - Severe internal dissent / chaos may generate enough internal instability that the military wants to establish a more secure regime. A high external threat environment can do much the same; if the military feels a regime is not assisting the military enough in providing a security guarantee against external enemies it may intervene in politics to establish more favorable military policy. (Syria, Pakistan)
Sectional Interest - Defense of a region, class, ethnicity, the military itself as an institution (in terms of autonomy, privilege, wealth, size), or simply naked self-interest. This occurs when the officer corps is 'stacked' in such a way as to create an identification between the military and other political / economic / social interests - ie, ethnic armies). (Syria, ((again,)) Central African Republic and indeed most of African coups)
Lack of Regime Legitimacy & Institutionalization - Self-explanatory. Regimes that come into power illegitimately (by force) are far more likely to be ousted by force. Institutionalization means the general effectiveness of the bureaucracy to create a stable, working, improving body politic. If you lack it, citizens will hardly mind, notice, or care that your shit regime has been overthrown.

Now let's look at when the military has opportunity to intervene:

Overt crisis - Internal rival political forces have taken up arms, regime depends on military, military intervenes to stop political fragmentation or ally with a more pro-military faction.
Latent crisis - Political / social minority rule in such a way that the masses hate them and the military is the only thing standing in between the regime and destruction. Dependence allows military to assert its preferences.
Power vacuum - No organized political movement of any strength. Child's play.

So, in sum, we have: The most common method of political supplantment is the military coup; the military is the most common culprit because it is a separate, insulated body from the rest of society and because it has a unique identification with the 'national interest'; it intervenes when its interests or the interests of the state are severely threatened by general dysfunction threatening social collapse or intense antagonism towards the military.

So, how do we protect ourselves from this? This is where it gets fun. Let's pin on some fake military medals, grow a moustache, and delve into the world of:

/r/explainlikeimfive Thread