For the past four decades, the same two countries have been the agents of chaos in the Middle East. The cavalcade of catastrophe is speeding up: Journalists are being assassinated, armies and proxy armies are waging war, and embassies are on the brink of being sacked and overrun. But the culprits, the powers responsible, have remained unchanged: Iran and Saudi Arabia, in a duel between Shiite and Sunni that has claimed the whole region as collateral damage.

That is the thesis of Kim Ghattas’s new book, “Black Wave,” an ambitious retelling of the past four decades in the greater Middle East. She identifies 1979 as the year when everything started going haywire. In that year, the shah’s government in Iran fell to the frenzied mobs loyal to Ayatollah Ruhollah Khomeini. Less well-known is the seizure of the Grand Mosque in Mecca by a millenarian, proto-Islamic State movement, which the Saudi government dislodged only at a cost of hundreds dead. The first of these cataclysmic events brought the successful establishment of an intolerant Shiite government. The second, an upswelling of Sunni fanaticism, failed only because an authoritarian (and only slightly less fanatical) Sunni government crushed it.

The choice of these two events is not especially daring. That they happened in the same year and are religiously symmetrical has attracted the attention of many observers before, although Ghattas’s insistence on the pivotal, rather than merely symbolic, importance of these events is more emphatic than most. She connects them to episode after episode in the region’s history, which she revisits at great speed, ranging across borders like a writer trying to collect passport stamps. The most vivid accounts, curiously, are from the seminal twin events themselves — the Grand Mosque seizure and the Iranian revolution — and not from the more recent past. The apocalyptic Sunnis in Mecca sound like the Manson family, minus the sex and rock-and-roll, and Khomeini (never a genial figure) comes across as soulless and sociopathic. She adds a sympathetic portrayal of Musa Sadr, the Iranian charismatic cleric who she suggests might have prevented Khomeini’s rise, had he not been murdered in Libya in 1978.

Among the secondary effects of these two movements is an emboldened Islamist wave elsewhere. Ghattas traces the assassination of Egypt’s Anwar Sadat, fresh from making peace with Israel, to a Sunni impulse to copy Khomeini’s success but in a Sunni form. Egypt lacked a Khomeini to lead its population to “rise as the Iranian masses had risen,” she says, and remained a secular dictatorship for the next three decades only because of that absence. She notes too the ties between the Sunni ideologues of Pakistan and the Iranian leadership. Pakistan’s tilt toward Sunni fanaticism under Mohammed Zia ul-Haq is another result of blending Iranian political innovation with Sunni belief. In her telling, the Sunni and Shiite authoritarian strains amplify each other, with Khomeini learning from Sunni thinkers, such as the Egyptian Sayyid Qutb, and Sunnis mimicking Iranian success wherever they can.

At the heart of these dueling rigidities, Ghattas suggests, are two terrible ideas. On the Shiite side there is “wilayat al-faqih,” the “guardianship of the jurist,” whereby religious scholars exert total political control, no matter how narcissistic or crazy they are. On the Sunni side there is Wahhabism — a form of hyperliteral, austere, intolerant Islam born in the Arabian Peninsula more than 200 years ago and enshrined in Saudi Arabia as the state religion. Ghattas goes to great (and mostly worthwhile) effort to demonstrate that neither of these ideas is the sole or natural outcome of Shiite or Sunni Islam. Instead they are unfortunate heterodoxies that power-mad individuals have adopted to advance their own interests.

Most of this history is well-known, and almost every chapter’s historical episode already has multiple books in English written about it. But Ghattas’s contribution, as an aggregator of these accounts (she does original interviews, but most of the narrative comes from secondary sources), is to situate Sunni and Shiite politics as forces that both oppose and learn from each other. The disdain in the rhetoric between Saudi Arabia and Iran might lead one to conclude that these enemies hate each other and detest each other’s example. But of course hate sometimes arises from similarity, and each envies the other’s successes and tries to replicate them. In 1989, Iran sentenced Salman Rushdie to death and reaped massive publicity. In the 1990s, blasphemy charges proliferated in Egypt and Pakistan, in a perverse Sunni imitation of a trick that worked.

Ghattas ends with a chapter whose episode still has no definitive book-length treatment — the murder of Washington Post contributing columnist Jamal Khashoggi by agents of Saudi Arabia and its Crown Prince Mohammed bin Salman. But that episode fits least naturally into Ghattas’s narrative. Under Mohammed and with the support of the United States, Saudi Arabia has confronted Iran with more force than in decades past. But what Ghattas identifies as the original sin of Saudi Arabia, its intolerant strain of Sunnism, is absent from the roster of crimes alleged against Mohammed. The crown prince, as Ghattas points out, is anti-Shiite, but he is much more focused on bringing WrestleMania, Western movies and economic diversification to his conservative, stifled kingdom. The economic changes are moving slowly and without clear results. But the social liberalization is happening, and it represents a peculiar and welcome change from the past 40 years of Saudi history.

Ghattas stresses the murder and political repression, as she should, and hopes for “a better path forward” than the leaders of these countries have thus far offered. What might sound like an optimistic note, however, is in fact a depressing one. The only better paths forward that she proposes are people who have ended up driven into exile, ruined or chopped into bits. The black wave has wiped out most everything in its path, and when it subsides, the region will require real bravery and ingenuity to rebuild.

Black Wave

Saudi Arabia, Iran, and the Forty-Year Rivalry That Unraveled Culture, Religion, and Collective Memory in the Middle East

By Kim Ghattas

Henry Holt. 377 pp. $30