Although there are still a lot of Islamic terrorists operating in Iraq, over the last few years, United States forces there have been able to avoid most of the violence. Iraqi forces have been doing most of the fighting. So far this year, 44 American troops have died in Iraq, compared to 273 in Afghanistan. This is for about the same number of troops in both countries (although U.S. forces are declining in Iraq and growing in Afghanistan.)
The main reason for this is the better security for U.S. troops in Iraq, and the fact that most Iraqis are willing, and able, to provide information about the terrorists. This includes the three terrorist groups funded by Iran, that actively go after American troops. The Sunni Arab terrorists mainly target pro-government Sunnis and Iraqi Shia Arabs). Iran is particularly frustrated that its Iraqi terrorist groups have been unable to get at the Americans. This is largely because, as recent polls pointed out, 85 percent of Iraqis do not want any Iranian interference in Iraqi politics. Iraqis also see America as the ultimate guarantor that Iran does not try to annex all or part of Iraq.
Iraqis know they have a problem with radical factions in the Iranian government, who are allowed to run their own terrorist operations in foreign countries. The Iranian Al Quds Force (an intelligence and commando operation that supports Islamic terrorism overseas) always attracted very bright and able people, but also got personnel with a wide range of views on just what constituted an "Islamic Republic" or the proper role for the Quds Force itself. For over two decades, one of the few things Quds officers could agree on was the need to remove Saddam Hussein from power. Many Quds officers actually warmed to the United States for doing the deed for them.
Once the Americans had overthrown Saddam, Quds operatives were sent to Iraq to see if they could establish another Islamic republic there. But they quickly found that Iraqi Shias were very divided on that subject. This got many Quds officers disagreeing with their commanders back home. The feeling was that the officials back in Iran were living in a dream world. This was reinforced by the debate over al Qaeda. Even though this Sunni terrorist organization was violently anti-Shia, and had killed many Shia in places like Afghanistan and Pakistan, some Quds officials backed supporting al Qaeda, because of a common enemy, the United States in particular, and the West in general. This sort of thing can happen because the Iranian leadership is more a federation than a dictatorship. So Quds can keep being nice to al Qaeda as long as not too many other Iranian factions get mad at Quds. So the Iraqi government negotiates with more moderate members of the Iranian government, on how they can cooperate to control Quds, and other Iranian radicals trying to stir up trouble inside Iraq.
By 2007, even Sunni Arabs in Iraq had turned on al Qaeda, and all Iraqis became aware of the Iranian support for the Sunni terrorists. Continued Iranian support for Iraqi terrorists, even if they are Shia, is not appreciated in Iraq, and that does a lot of keep American casualties down.