Peaceful transition of power is the most important factor in the long-term stability of any system of governance. Whenever a leader loses legitimacy or dies, there must be a process to select a successor. If the outcome of the process is contested, the system is at a high risk of collapsing in the power struggles of its elites. It's far more common for a state to fail due to internal power struggles than external threats.