Frontline: The Secret History of ISIS. PBS. Tuesday, May 17, 10 p.m.

The most significant TV show in the world doesn't air on American television. It's the steady stream of appallingly bloodthirsty videos released on the Internet by ISIS, which provide a ghastly blueprint of the group's plans for a worldwide Islamic caliphate.

"I get a steady diet of these videos they put out," says New Yorker correspondent Dexter Filkins. "So today they stoned to death a man because they suspected him for being gay, or they stoned to death a woman, or they put a man in a car and exploded it, or they skinned somebody alive, or they crucified somebody, or they beheaded somebody. Every day."

Filkins' recitation of video highlights comes from The Secret History of ISIS, a grim, incisive episode of the PBS documentary series Frontline, produced, directed, and co-written by Michael Kirk, a veteran chronicler of both U.S. intelligence and the Middle East. It's a fine work of journalism that explains the origins of the jihadist group that President Obama once contemptuously referred to as "a JV team" that now controls roughly a quarter of the territory of Iraq and Syria.

And though The Secret History of ISIS is neither ideological nor prescriptive, it necessarily implies a lot of troubling questions about American ability to even understand, much less control, events in the Middle East.

As Secret History notes, the sudden public materialization in 2014 of ISIS as a terrorist quasi-state presiding over a vast swath of western Iraq "seemed to come out of nowhere." Wasn't our chief enemy in the Middle East supposed to be the battered al Qaeda, virtually rudderless under a lethal rain of drone missile strikes?

Americans confused by the shuffled military deck may find it comforting (or perhaps just depressing) when former secretary of defense Chuck Hagel admits in Secret History that the seizure of Fallujah, Ramadi and other major Iraqi cities was, for the most of the U.S. government, "the jolting gong that said, how could this happen?"

In fact, the group that would eventually call itself ISIS had been on the CIA's radar since the days immediately following Sept. 11. Its leader was a Jordanian career criminal, radicalized in prison, who went by the name Abu Musab al-Zarqawi. (His more prosaic prison nickname had been the Green Man, referring to the color of the tattoos covering his body, but when he turned jihadist, Zarqawi had them removed with a smuggled razor blade.) After his release from prison, Zarqawi went to Afghanistan in hope of bringing his small group into al Qaeda.

Secret History meticulously traces Zarqawi's fascinating passage from petty prison enforcer to theocratic madman, with special emphasis on his talent for (and grand luck at) exploiting the kinks in U.S. policy.

Rejected by Osama bin Laden, Zarqawi set up shop in Iraq. The CIA, certain he was tinkering with biochemical weapons inside his camp, devised a plan to kill him with a bomber strike … but the Bush administration, though on the verge of launching a massive shock-and-awe war against Iraq, had a sudden case of prissy-pants. "Let's not start the war before we're ready," former Secretary of State Colin Powell recalls arguing. Instead, administration officials contented themselves with arguing to disbelieving CIA analysts that Zarqawi's presence in Iraq proved a connection between Saddam Hussein and bin Laden.

Zarqawi, meanwhile, bided his time. When victorious American forces began purging the Iraqi army of all members of the vanquished Saddam's political party, which left hundreds of thousands of militarily trained Sunni Muslims out of work and tipped the balance of political power to their Shia rivals, Zarqawi launched a hellish assault of car-bombs spiced with the occasional on-line decapitation video. "It was murderous, it was psychopathic, it was horrific," recalls a journalist who was there.

The CIA had spotted Zarqawi's hand in the violence right away. But once again, Bush administration officials refused to go along with the agency's analysis, mostly because they didn't want to admit there was organized resistance to American occupation. Among the most captivating moments in Secret History is an interview with a CIA officer who answered the phone at her desk one afternoon and was stunned to find vice-presidential chief of staff Scooter Libby on the line, haranguing her for an unsigned analysis she'd written about Zarqawi in the presidential daily brief. It was only when Zarqawi himself appeared on a video beheading an American construction worker with a machete that the White House gave up the fight—and in a big way, posting a $25 million reward that gave new meaning to the old Green Man name.

As the body count mounted, even bin Laden—who at first was impressed and persuaded Zarqawi to operate under the name al Qaeda In Iraq—became appalled, sending a letter telling him to stop killing so many Muslims lest he launch a civil war between Sunnis and Shia. But that was precisely Zarqawi's strategy: to use the chaos of a civil war to make a power grab. He soon released another video, this time without a balaclava covering his face, to proclaim his goal of a worldwide Islamic caliphate, a goal beyond even bin Laden's grandiose ambitions.

Zarqawi was killed in a U.S. air strike in 2006, and his group pushed near the point of extinction when Sunni Muslims weary of the violence allied with U.S. troops in the so-called surge strategy. Perhaps as few as three dozen survived, now led by an Iraqi calling himself Abu Bakr al-Baghdadi, who learned the jihadist trade in a U.S. military prison early in the war.

If anything, Baghdadi's bloodlust was even more intense than Zarqawi's. "Degradation cannot be erased except by sacrificing souls and lives, spilling blood, scattering carnage, skulls, martyrs and injured all along the way," he declared. When civil war broke out in Syria, creating more bedlam, he was ready to pounce.

ISIS now not only controls enough territory to justify its description of itself as a state, it has proven itself a worldwide threat, planning or inspiring more than 90 overseas attacks that have taken more than 1,000 civilian lives. Its alliances with more 40 other terrorist organizations will only extend its reach. Flatly declares Secret State: "The worst is yet to come."

That's an unsettling idea without any easy solutions—or even hard ones—in sight. ISIS's forthrightly internationalist ambitions for mayhem cannot be ignored. Yet there's nothing in the past four decades of American policy in the Middle East that suggests we have the capacity to control or even contain events there. From CIA aid to anti-Soviet mujahideen in Afghanistan to American support of Kuwait against Saddam Hussein's invasion, it's been one long, grisly and as yet unlearned lesson in unforeseen consequences. Watching Secret State, it's chillingly clear that it isn't over yet.