Ever since 2003, the U.S. presence in Iraq has reinforced cooperation between Iran and some significant portions of Iraq's Shiite community, and especially those elements (such as Muktada al Sadr's Mahdi Army) who really wanted the United States to get out. But once we withdraw, then it is far from obvious that the bulk of Iraqis -- including most Iraqi leaders -- will want to become a satrap for Iran. It's true that the Sunni-Shiite divide provides Iran with some avenues of influence in Iraq society, but there's also the enduring division between Arabs and Persians and Iraq's overriding interest in not allowing Iran to become a hegemonic power in the Gulf region. Let's not forget that the two countries fought a brutal and costly war for most of the 1980s, and plenty of Iraqi and Iranian Shiites killed each other during that conflict.
The Indochina war offers an obvious historical analogy. One of the reasons the United States fought there for so long was the familiar domino theory -- the dubious idea that a communist victory in Vietnam would trigger a cascade of falling dominos and undermine the entire US position in Asia (and possibly elsewhere). But when the United States finally got out, the exact opposite thing happened: none of our other Asian allies abandoned us and China and Vietnam had a rapid falling-out that led to war between the two communist states in 1979. And over time, of course, China abandoned Maoism and Vietnam grew more and more interested in better relations with America. And let's not forget that fourteen years after Saigon fell, it was the Soviet Union that ended up on the ash-heap of history. Once we stopped pouring troops and bombs into Indochina, in short, our strategic position began to improve and we could focus on the more serious aspects of Cold War competition.
In short, if you really think Iran is a threat to dominate the Gulf region, and if you also believe that states tend to balance against threatening powers instead of band-wagoning with them, then you should also expect the U.S. withdrawal from Iraq to encourage more regional powers--including Iraq--to take actions to limit Iranian power and influence. And that might also include being a bit more favorably inclined toward the United States, despite all the other things we do that tick off people in that part of the world. That could be why we're getting a positive response to these new initiatives, and that's why getting out of Iraq may actually bolster our overall strategic position.
Putting aside the historical analogy, the notion that Iran will continue to dominate Iraq and the wider Gulf upon U.S. withdrawal seems misplaced. First, as Walt notes, Iranian strength will likely inspire balancing on the part of Iran's neighbors. Second, for historical and cultural reasons, Iraq is more likely to align with its Arab neighbors (who will engage in balancing) than to band-wagon with Persian Iran, despite the fact that the majority of Iraqis are, like the vast majority of Iranians, Shiite.