The escalating tension between Saudi Arabia and Iran is the story of a declining state desperately seeking to reverse the balance of power shifting in favor of its rising rival.

History teaches us that it is not rising states that tend to be reckless, but declining powers. Rising states have time on their side. They can afford to be patient: They know that they will be stronger tomorrow and, as a result, will be better off postponing any potential confrontation with rivals.

Declining states suffer from the opposite condition: Growing weaker over time, they know that time is not on their side; their power and influence is slipping out of their hands. So they have a double interest in an early crisis: First, their prospects of success in any confrontation will diminish the longer they wait, and second, because of the illusion that a crisis may be their last chance to change the trajectory of their regional influence and their prospects vis-à-vis rivals. When their rivals — who have the opposite relationship with time — seek to deescalate and avoid any confrontation, declining states feel they are left with no choice but to instigate a crisis.

Saudi Arabia is exhibiting the psychology of a state that risks losing its dominant position and whose losing hand is growing weaker and weaker. This explains why an otherwise rational actor begins making seemingly panicky and incomprehensible moves. From its decision to give up a seat on the United Nations Security Council — after having campaigned for it for over a year and celebrated its election to the UN body only a day earlier — to its reckless and failing attack on Yemen, to its push against the nuclear deal with Iran, to the deliberate provocation of executing Shia political dissident Nimr al-Nimr, its conduct is that of a sunsetting power.

Iran, on the other hand, is by all accounts a rising power. Ironically, much of Iran’s rise is not due to its own actions, but must be credited to the reckless mistakes of its adversaries. The U.S. invasions of Afghanistan and Iraq eliminated Tehran’s primary nemeses to its east (the Taliban in Afghanistan) and its west (the Saddam Hussein regime in Iraq). In addition, Iran’s own Machiavellian maneuvering also ensured that it — and not the U.S. — has become the most influential outside actor in those two.

Even though the Syrian civil war has been very costly to Iran in terms of resources, soft power and standing in the Arab world, Tehran views the survival of its ally, the Bashar al-Assad regime, as reconfirmation of Iran’s power and deterrence. Although Iran cannot be declared a winner of the Arab spring, it has probably lost the least compared to Saudi Arabia, Turkey and the U.S. Moreover, the nuclear deal has opened the door for Iran’s rehabilitation among the community of nations. Once a pariah in the eyes of many key states, Iran exercises power and influence in the region that is now increasingly accepted.

Furthermore, the European Union has made no secret that it views the nuclear deal as a first step towards a broader rapprochement with Iran and recognizes that the international community must work with Iran in order for it to be a force for stability. In fact, the EU’s support for reengagement with Iran is partly driven by its assessment that the West’s current relationship with Saudi Arabia isn’t sustainable. As the New York Times has reported, in the current standoff between Saudi Arabia and Iran, EU sympathies tend to lean toward Tehran.