Stability isn't really a function of the system of government, but rather how resilient and effective that government, society, and culture is is to addressing its own problems, be they from inside or outside its borders. No type of government has a monopoly on competence.
Societies with democratic mechanisms are a double-edged sword in this way. On one hand, being able to remove shitty governments without bloodshed is nice and elections give it a sense of popular legitimacy- the loser may be bummed but they can't exactly argue so much if they lose a fair election (hypothetically, if someone were to win the popular vote but still lose the election by other means, that might make a country less stable). On the other hand, these systems are subject to legislative paralysis as divides over certain issues grow. If, again hypothetically, paralysis becomes the most politically advantageous thing to do if you want to win elections, that could become an even bigger problem.
In many ways the founding fathers of the US knew about some of these pitfalls and tried to correct for them in ways we don't like to admit now. They created a form of government that would permanently install an educated, landowning elite to run the country, but elections to give them incentive to look after the popular will.
Of course, totalitarian governments can also be stable, but for them a lot of the calculus changes. Instead of pacifying the discontent populations with elections to lend legitimacy, it becomes all about pacifying them through information control (something increasingly difficult to do now). The more discontent population becomes, the more difficult it is to stay stable. China is able to stay stable partially because it has thousands of history of centralized government and planning, and the current crop of communists are education technocratic types, not mob populists looking to pick very old grudges back open.
Then there is simply the societal and cultural factors. If one chunk of the country hates another chunk from the very beginning, then it doesn't matter what kind of government you have, you're fucked. The culture is either going to have to change to a point where they no longer hate each other, or you're never going to get real stability. This is why places like the middle east and parts of Africa remain perpetually unstable, when their country lines were drawn to include many disparate groups who felt no real kinship toward each other. Federalism (like with American states) can help offset some of this, depending on how deep the hatred runs.