"Military coups aren't the most likely model for destroying democratic institutions," argues University of Chicago Law professor Aziz Huq. "One lesson is that the road away from democracy is rarely characterized by overt violations of the formal rule of law. To the contrary, the contemporary path away from democracy under the rule of law typically relies on actions within the law."
The process is known as democratic backsliding, says Alexandra Rosenmann at AlterNet.org.
Central among these legal measures is the early disabling of internal monitors of governmental illegality by the aggressive exercise of (legal) personnel powers. Often, there are related changes to the designs of institutions, which might be brought about through legislation, Professor Huq explained. "Ironically, the law is deployed to undermine legality and the rule of law more generally."