I'll mention two primary factors (both of which I discuss in my book . First, Pakistan has had periods of significant political instability. Military coups happen when the civilian political branches are weak or divided, and there's a power vacuum for the military to fill. Coups against stable governments rarely succeed.
Second, coups beget future coups. The more recently a country has experienced a coup, the more likely they are to experience another one. Pakistan fits that pattern.
There are other factors as well, but those are two main ones.
Thanks for your response. I should mention at the outset that some of the abuses you list (e.g., gerrymandering) exist on the Democratic side as well. I don't view the issue as a "Republican" or a "Democrat" problem. It's a problem of democratic decay.
The question then becomes how bad does the decay have to get before a democratic coup becomes tolerable? We're not there yet. Yes, the electoral abuses you mention make it harder to dislodge the incumbents, but it's still possible. Politicians and presidents are voted out of office regularly, and when they lose elections, they leave, without tanks rolling on the ground.
Think of a coup like chemotherapy: an extreme measure reserved for extreme cases, where the side effects can sometimes be as harmful as the cure is effective. I discuss these side effects in my book (which I hope you'll read).
Sure, there are lots of them. I'll name a few: Portugal, Romania, Serbia, Hungary, Mali, Colombia, Guinea-Bissau, and even the United States (which was under British dictatorial rule before the colonies declared independence).
I cover most of these cases in my book .