The execution of a Shiite cleric in Saudi Arabia and the burning of Riyadh’s embassy in Iran has one again flamed Sunni-Shiite tensions and set the tiny Arab oil sheikhdoms on edge. Leaders from Lebanon to Yemen are fretting about Iranian machinations in Arab countries. But it is Tehran’s involvement in Syria that worries them the most. Tehran has bolstered its client state by dispatching senior military figures, pressing its Lebanese client Hezbollah to send fighters, providing much-needed petroleum products and extending Syria a hefty line of credit.

Without Iran’s help, the regime would likely have collapsed. Some believe Tehran has backed Syria to the hilt because of their common religious roots. Both ruling cliques claim affinity with the heterodox Shia, who are a minority in an Islamic world populated by orthodox Sunnis.

But Iran’s Syrian strategy derives less from spurious religious ties than it does from geopolitical factors. Surrounded by hostile pro-Western nations, Iran needs all the allies it can find to ensure that its regional interests are protected.

Little binds the Iranian Shia, known as Twelvers, with the Alawi Shia who rule Syria. The ninth-century founder of the Alawi sect was an adherent of the eleventh of the Twelvers’ religious leaders. He promoted doctrines that were incompatible with Twelverism and was declared an infidel by medieval Twelver scholars. Later Alawi theologians went even farther, abrogating many of Islamic laws such as fasting during the month of Ramadan while advocating the non-Islamic concept of the transmigration of souls. They went so far as to deify Muhammad’s cousin Ali, claiming that he was the true recipient of the prophetic message. They adopted Christian and pagan holidays.

These teachings did not sit well with medieval Twelver scholars. The tenth-century Twelver heresiographer Abu Muhammad al-Hassan ibn Musa al-Nawbakhti claimed the Alawi founder propagated the un-Islamic belief of the transmigration of souls and permitted homosexual relations. Jurists such as the eleventh-century scholar Muhammad bin al-Hassan al-Tusi accused the Alawis of heresy and cursed them for permitting what was forbidden.

This suited the Alawis. They believed they were the true holders of the original Islamic message, and had little affection for Muslims who refused to follow them. The Twelvers viewed them as enemies, and in 1834 raised troops for the Ottomans to quash an Alawi revolt.

Sometimes Alawis did not even identify as Muslims. When European travelers began visiting Syria in the eighteenth century, Alawis informed them they were Christians. Isolated in their mountain strongholds, they had little interaction with Muslims. But modernity shattered these walls. To prevent missionaries from claiming them as lost Christians, the Ottomans asserted they were Muslims. Mosques were built. But the Alawis rejected these attempts of integration into the Islamic community. When the French ruled Syria, they too tried to incorporate them into the Islamic fold. Twelver judges were imported to establish courts. But the Alawis rebuffed them as well. In 1948, Alawi students went to the Twelver center of Najaf, Iraq to learn their doctrines. But after being ridiculed and scorned, most quickly returned home.

In the 1960s, Alawis officers took power in Syria. But they did not establish cordial ties with Iran. Instead, it was the Iran-Iraq war that proved a turning point. Tehran was an international pariah, rejected by the West and fearful of Soviet communism. It was desperate for allies. The Syrian president detested his Iraqi counterpart and saw the war as an opportunity to weaken him. Iran bolstered a flailing Syrian economy in 1982 by providing free oil. But religious ties between the Alawis and Twelvers were as strained as ever. A 1985 American diplomatic cable noted that Twelver scholars “view the Alawis as heretical and despicable.” Indicative of the abyss between them, Twelvers sought to proselytize among the Alawis. Six preachers were arrested for doing so in 1996.

But even shared adversaries could not overcome the abyss separating them. When Iran flexed its muscles in the Middle East, Syria often recoiled. After Iranian gains against Iraq alarmed Saudi Arabia in 1986–1987, Syria sought to restrain Tehran. In 1987, Syrian forces clashed with Hezbollah, as its gains threatened the fragile balance between Lebanon’s myriad sects. Syria was never comfortable with the Iranian-Hezbollah strategy of kidnapping Westerners in Lebanon. And Damascus exposed the existence of American weapons sales to Tehran in what became known as the Iran-Contra affair.

When Iran made claims on several islands controlled by the United Arab Emirates in 1995, Syria backed the tiny nation. And Syria was never comfortable with Iran’s attempt to export its revolution to other Shiite communities. During the past decade, Damascus has allied with Sunni Arab nations in criticizing Tehran’s links to Shiite groups in Saudi Arabia and Yemen.

Economic ties between the two countries were never robust. In 2007, Iranian-Syrian trade only amounted to about one-third of Washington’s commercial exchanges with Damascus. One area where the two cooperated was tourism. Iranians constituted approximately 20 percent of all tourists to Syria. Most are pilgrims, who visit Shiite religious shrines that hold no religious importance to Alawis.

Iran and Syria built a defensive alliance based on mutual adversaries and fears. Historically apprehensive of American and Israeli designs in the Middle East, they share limited interests beyond their anti-Western ideology. But even this was not enough to persuade Syria to put both feet in the Iranian camp. Damascus always tried to keep Tehran at a comfortable distance, so as to not alienate Saudi Arabia and the other Gulf countries.

Today, Iran fears the fall of the Alawi regime would result in a Sunni government, which would ally with its rival Saudi Arabia. It worries about the regional isolation that would ensue. Iran also dreads the spread of the Wahhabi ideology that Riyadh propagates. The virulent anti-Shiite doctrines that the Islamic State in Iraq and Syria (ISIS) endorses were born in Saudi madrasas.

Equally worrying is that a Sunni Syria would prevent Tehran from sending arms to Hezbollah. An Alawi fall would wipe out the regional gains that it has carefully cultivated for almost forty years.

Though not wed to Syrian President Bashar al-Assad, Tehran cannot afford to see the Alawis relinquish power. For this reason, it will stubbornly cling to the status quo, refusing to make any tangible concessions during negotiations. The Sunni government that Saudi Arabia aspires to install in Damascus is anathema to Tehran, and must be prevented at all costs.

It is this fear of Sunnis that brings Iran and Syria together. Their defensive alliance is built on interests. Emphasizing their common Shiite roots only obscures the relationship. Ignoring this reality, and believing that Iran can play a constructive role in resolving the Syrian conflict, only strengthens ISIS and prolongs a conflict that increasingly reverberates in Europe and beyond.

Barak Barfi is a senior fellow at the New America Foundation.