It has happened many times in the past. Very often the leadership of the country is not by one person but more often by a council, even if nominally, there is one leader. Each person in that council will be worried about their own position if a new leader comes along, so they all will play along together, to try and keep things as they were. It is wise for any leader or country to plan well ahead as to how the country will be governed in the event of the leader's death or incapacity - temporary or permanent. Well-laid plans that everyone knows about and that are put into place as necessary are the best way of maintaining a peaceful country. It is unfortunate where countries have a strong ruler, with many advisers who love their positions and no plans for continuation of peaceful rule in the future.