(CNN) Let's try to work this out.
Saudi Arabia and the United Arab Emirates (Sunni, US allies, conservative monarchies) lead a campaign to isolate neighboring Qatar (Sunni, US ally, conservative monarchy.) The charge: that Qatar "embraces various terrorist and sectarian groups aimed at destabilizing the region."
At the same time, just to complicate things, President Donald Trump appears to throw in his lot in with Saudi Arabia, tweeting that he hopes Qatar's isolation may hasten "the beginning of the end to the horror of terrorism!" This even though a large US air base hosted by Qatar is a hub in the aerial war against ISIS.
And then ISIS claims to carry out terror attacks that kill 12 people in Tehran. And Iran's Revolutionary Guards blame the Saudis.
None of it seems to make sense. But all these events can be seen through the prism of a much larger struggle - about regional superiority, the war against terrorism and sectarian distrust between Sunni and Shia followers of Islam. And the main belligerents: Iran and Saudi Arabia.
On the face of it, for Riyadh and friends to place a fellow member of the Gulf Cooperation Council under siege is odd if their real enemy is Iran. But Saudi anger, shared by the UAE, Jordan and Egypt, is directed at Qatar's mercurial and independent foreign policy, which includes cordial relations with the Islamic republic across the water.
Qatar isn't completely isolated. Turkey has fast tracked a decision to approve the deployment of troops to Qatar -- part of an existing bilateral agreement but widely interpreted as a show of support.
Why should Qatar even want to get on with Iran? In part, it's gas. The two countries share a huge field under the Persian Gulf. Kuwait -- which is now trying to mediate in the Arabian bust-up, also shares oil resources with Iran.
The Saudis and their allies in the Emirates also see Qatar as promiscuous: it has flirted with Israel, embraced the radical Muslim Brotherhood and offers shelter to the radical Palestinian group Hamas, all while using the pan-Arab reach of the al Jazeera news network to convey its perspective. There is certainly more than an idiosyncratic streak to the al-Thani dynasty in Qatar.
To the Saudis and the Egyptians -- and, ironically even the Israelis -- the Muslim Brotherhood is inextricably linked to Hamas -- and even al Qaeda. And they see radical elements in Iran as keeping these militant Sunni groups alive -- in a cynical Faustian bargain -- even though Iran is Shia.
Saudi officials recall bitterly how Iran provided senior al Qaeda figures shelter after 9/11, even as the terror group launched attacks across the kingdom.
One former member of al Qaeda, who was close to several senior figures in the group before 9/11, told CNN that many Muslims believe they are in the middle of a generational conflict for the soul of Islam.
It's a specter that's haunted Arab regimes for decades, since the overthrow of the Shah of Iran in 1980. Former President Hosni Mubarak of Egypt spoke a decade ago of "Tehran's hand moving with ease throughout the region, from the Gulf to Morocco," according to US diplomatic cables at the time.
This confrontation has deepened with the Syrian civil war. The rise of ISIS and the prominent role of Iran -- in both Iraq and Syria -- has redrawn the balance of power in the Middle East. Jordan's top military officer, Gen. Mahmoud Freihat, said recently that Iran was trying to carve out a "land belt" between its territory and Lebanon -- right the way across Iraq and Syria, partly motivated by a very real fear of ISIS.
Just last week, pro-Iranian militia seized a town (Baaj) held by ISIS just inside Iraq, while their comrades on the other side of Iraq's border with Syria tried to attack a US base (Al Tanf) supporting moderate Sunni rebels.
The awful war and humanitarian catastrophe in Yemen is another example of this larger struggle. Once a country where sectarian identity was less important than left and right, its Shia minority -- the Houthis -- are clinging to power in one part of the country, under bombardment by the UAE and Saudi Arabia, while al Qaeda prospers in another. The Saudis, predictably, accuse Iran of arming the Houthis; Iran, predictably, denies the charge.
But why has this long-simmering animosity now burst into the open? First, according to some reports, Saudi Arabia was infuriated by a complicated ransom deal Qatar did in April to secure the release of nearly 30 prominent Qatari citizens held in Iraq.
The terms of that deal are unknown, but both Iran and jihadist groups in Syria are reported to have been beneficiaries.
Iraqi Prime Minister Haider al-Abadi said suitcases containing hundreds of millions of dollars were seized from a private Qatari jet in Baghdad. Qatar's foreign minister insisted his government "did not deal with armed groups outside the authority of the (Iraqi) state;" Riyadh didn't believe him.
Then came the infamous alleged hack of the Qatari news agency on May 23, and the planting of a report quoting the Emir as saying: "There is no wisdom in harboring hostility towards Iran." Saudi and UAE media went to town with the reports.
But part of the answer may lie a hemisphere away in Washington. The Saudis didn't like or trust the Obama administration, especially after it jettisoned their good ally Mubarak in Egypt (2011) and made a nuclear deal with Iran (2015). There was a sense that as the US moved toward energy independence, it would care less about the Gulf.
So Riyadh's younger generation of decision-makers set out on a more assertive foreign policy, which included putting Qatar in its place.
To some analysts, President Trump's recent visit to Saudi Arabia only encouraged this boldness -- against Qatar and Iran.
"His open embrace of the more hard-line factions in the Kingdom sent a signal to Tehran that regardless of its policies, the United States wouldn't be responsive to changes in Iran," such as the re-election of President Hassan Rouhani, say Dina Esfandiary and Ariane M. Tabatabai at Foreign Affairs magazine.
While in Riyadh, Trump told a meeting of Arab heads of state that Iran was the chief source of instability in the region, providing terror groups with "safe harbor, financial backing, and the social standing needed for recruitment."
Which brings us to Wednesday's terror attack in Tehran. For ISIS, which claimed responsibility in a statement and video, it's a symbolic strike at the heart of "Safavid" (derogatory term for Iranian) darkness.
For its part, Iran's Revolutionary Guards Corps said the attack "was perpetrated soon after the meeting of the US President with the heads of one of the reactionary regional states that has always supported "Takfiri' terrorists," aka Saudi Arabia.
And so a little more fuel is added to a fire well set.