The still-unraveling scandal that has forced the resignation of CIA Director David Petraeus has already touched on vital matters of U.S. national security. For starters: Did the spymaster pass information about the CIA’s secret work in Benghazi onto his mistress and biographer, Paula Broadwell? As the scandal continues to widen, there will surely be other pertinent, and likely more disturbing, questions raised.But perhaps the most significant question we’ll be left asking once the tawdry details stop leaking is: What happens to U.S. foreign policy when it loses a man of Petraeus’ experience, perspective, and institutional memory? For all of his peerless expertise regarding Iraq and Afghanistan, the question is especially relevant regarding Iran.According to former Petraeus aides, leading military officials, policymakers, and analysts close to the four-star general that I spoke to this week, Petraeus understood, more than anyone else in our national-security apparatus, that the Islamic Republic is at war with the United States. By Petraeus’ reckoning, they said, it’s not possible to strike a grand bargain with Iran over its nuclear weapons program because the larger problem is the regime itself, whose endgame is to drive the United States from the region. And no arm of the regime is more dangerous than its external operations unit, the Qods Force, whose mastermind, Qassem Suleimani, is considered by Petraeus to be a personal enemy.In seeing Iran as a threat to vital U.S. interests, Petraeus bucked the mainstream of more than 30 years of U.S. foreign policy. Presidents and legislators from both parties, as well as military and civilian officials, have tended to downplay the Iranian threat, seeking engagement with Tehran in the vague hopes of reaching a deal that might lead the regime to finally call off its dogs and leave us in peace. Petraeus, on the other hand, fought the Iranians.As commander of American forces in Iraq from February 2007 to September 2008 and in Afghanistan from July 2010 to July 2011, Petraeus fought Iranians’ local proxies and frequently the Iranians themselves, often drawn from the Qods Force. As head of Central Command from October 2008 to June 2010, the general had a large area of responsibility that afforded him an overview of Iranian activities throughout the region, in Lebanon, Syria, Yemen, the Persian Gulf states as well as Iraq and Afghanistan. During the course of almost a decade, Petraeus became Washington’s institutional memory of all of Iran’s activities directed against the United States and its allies.“He understood the Iranians’ modus operandi, and their mentality,” said one intelligence analyst who worked in Iraq and saw Petraeus’ work up close. “No one has dealt directly with the Iranian threat the way he has. We’re losing someone at the highest levels of government with the historical knowledge and ability to counter the Iranians.”Before the adultery scandal that forced his resignation on Friday, Petraeus was most famous as the commander who implemented the “surge” in Iraq, which is often credited for changing the course of the war. Petraeus’ campaign employed a large escalation of combat troops and a controversial counterinsurgency, or COIN, doctrine. Both the man and the idea were subjected to sharp criticism inside and outside military circles (including by this writer, whose understanding was faulty), which is hardly surprising given the acclaim heaped on Petraeus—or King David, as some rivals sarcastically referred to the general.COIN’s basic premise is to the win the “hearts and minds” of a local population by providing it with protection and thereby cutting off an insurgency’s base of local support. COIN advocates explain that this account is too simplistic. “There’s this idea that COIN is about showing up in a village with a bag of money,” Lt. Col. Joel Rayburn, an Army intelligence officer who worked with Petraeus from 2007 to 2010, told me. “But from the start, the idea was to interdict lines of external support, politically and militarily.”While the surge is usually believed to have focused all its energies against al-Qaida and Sunni militants, there was also a significant campaign against Iraqi Shia groups like Moqtada al-Sadr’s Jaysh al-Mahdi. Targeting their external lines of support—including money, weapons, and advisers—meant going after Iran. “When Petraeus came back to Iraq and took command in February 2007, my impression was that one of the things that struck him most was the level of Iranian involvement and its influence over the Iraqi government,” said Rayburn. “He clearly had a sense the Iranians were sponsoring killing our soldiers in Iraq and conducting operations against some of our allies.”Others told me that the Iranians were always a factor in Iraq, but there was little political will to do anything about it before Petraeus took command. Many U.S. military and civilian leaders, in Washington and on the ground in Iraq, simply chose to ignore it. Gen. George W. Casey, who commanded the multinational forces in Iraq before Petraeus, was, according to one senior military official, in “denial” about Iranian involvement. “They downplayed it—and you can understand why,” he said. “If the strategy is to hand security over to the Iraqi government, then it is problematic to be told that it is infiltrated by Iranian agents. If that’s true then the fundamental assumption is wrong, and you need to change your strategy.”When George W. Bush realized that he was in danger of presiding over an American defeat, he tasked Petraeus with the job of turning the Iraq war around. That meant looking at Iraq with fresh eyes and seeing Iran’s role clearly. “With the Iranians, there was a multipronged campaign to root out their operations in Iraq,” said Max Boot, a senior fellow at the Council on Foreign Relations who observed Petraeus in Iraq and later in Afghanistan. “That went from gathering intelligence, to arresting Iranian operatives, and pushing back Iranian influence.”The man in charge of Iran’s Iraq policy, and most of their foreign operations, was and remains Qassem Suleimani, the 55-year-old major general who commands the Qods Force. According to Michael Gordon and Gen. Bernard E. Trainor’s new book The Endgame: The Inside Story of the Struggle for Iraq, From George W. Bush to Barack Obama, Suleimani answers directly to Supreme Leader Ali Khameini. With the job of advancing the Islamic Republic’s interests through warfare and clandestine activities, Suleimani is perhaps the second-most important figure in the regime’s power structure. Recently he’s helped to shore up Bashar al-Assad’s besieged Syrian regime and participated in the plot to assassinate the Saudi ambassador to Washington. In a 2008 letter to then-Defense Sec. Robert Gates, Petraeus called Suleimani a “truly evil figure.”For the entirety of Petraeus’ tenure in Iraq, said Rayburn, “pushing back on Suleimani’s political and military influence was a key concern for him. He didn’t say it explicitly, but I believed he considered himself to be in war of wits against Suleimani.” The intelligence analyst agreed: “Petraeus saw Suleimani as his main adversary. We’d whack them, and then they regenerated because they had safe haven. But then he gave Suleimani an ultimatum, that he’d go after Qods Force.”In January 2007, U.S. forces captured five Qods Force operatives in Erbil, which was Petraeus’ way of sending a message to Suleimani. “After that, they no longer sent in their senior guys, they sent in proxies,” said the analyst. The Erbil Five were eventually released, which is to say that Petraeus’ campaign against the Iranians hardly amounted to a rout, especially considering the amount of influence Iran today exercises in Iraq, including its relationship with Prime Minister Nuri al-Maliki.And yet, Petraeus did considerable damage to Iran’s project in Iraq. “The Iranians tried to force us back down in 2006,” said the analyst. “But their militias were pushed out of Baghdad. By the end of 2008, all Iranian-backed militia leaders were dead or trying to take a taxi back to Iran. Ultimately they did not achieve their goals there. They want to project the image that they have more control than they actually do in Baghdad. It’s like when they photoshopped those ballistic weapons to make themselves look more powerful. It’s how they operate.”According to the sources I spoke with, many of the programs that Petraeus implemented, and the tools he used to push back against Suleimani and the Qods Force, are going concerns. Those will continue. But as far as having someone at the top levels of government who understands the Iranian’s tactics, and has fought them up-close, Petraeus will likely be impossible to replace.***Like this article? Sign up for our Daily Digest to get Tablet Magazine’s new content in your inbox each morning.Lee Smith is the author of The Consequences of Syria.