People tend to forget that Middle-Eastern countries are all pretty young from an institutional perspective. Before the mid-XX century they did not exist in forms resembling the current ones. Ottoman collapse, Arab consolidation and general decolonisation were fluid processes that sprung (or were forced to spring) very complex entities with all sorts of growing pains.
Yeah that's not what happened in Franco's case. He appointed Juan Carlos to succeed him as King of Spain. Juan Carlos was crowned after Franco's death, and decided to turn the country into a democracy. So we got lucky in that sense.
I disagree. As evidenced in the 23-F coup, the armed forces were either opposed to democracy, or loyal to the king. If Juan Carlos had wanted to remain an absolute monarch, all the machinery of the state would have kept turning as usual. The same way it did during 30 years of dictatorship during the Cold War.