Why has Iran managed to remain relatively stable since the major revolutionary upheaval of the late 1970s and a devastating war with Iraq in the 1980s, while Iraq has suffered innumerable horrors in the past two decades?

Compare and contrast the historical development of Iran and Iraq from the end of WWII to the present. Consider internal and external factors to explain their divergent trajectories. You must provide both a narrative of their respective histories since 1945 and an analysis of the most significant factors shaping the present reality of each. I uploaded the full detailed instructions.