On AQI: "The Sunni nationalist insurgency's strategic goal was to suppress the resurgent Shia, restore Sunni hegemony, and expel the Americans. The Sunnis lost the civil war to the Shia, no longer hope to rule Iraq alone, and increasingly turn toward the Americans for protection against the 'Persians'. Most of them flipped sides or went home, with the remainder gravitating towards the Al Qaeda in Iraq (AQI, which incidentally shares the ideology but is only loosely associated with AQ itself).
AQI's strategic goal went a bit beyond Iraq's borders, and included inspiring an Afghan-style jihad to expel the Americans (thus making them useful allies to the Sunni nationalists), and leveraging this victory into turning the Sunni parts of Iraq into a proto-caliphate (the Islamic State of Iraq, declared in late 2006, which their erstwhile local allies were less keen on). AQI nearly succeeded when the Samarra bombing and other atrocities deliberately ignited a bloody ethnic [I would say sectarian or ethno-sectarian] war that nearly destroyed (or finished destroying) the country. Eventually, however, it lost too. Significantly, its defeat is due in large measure to the rejection, in Anbar and elsewhere, of its ideology by what was supposed to be its core constituency: conservative Sunni Arabs under American occupation."
On JAM: "Although totally opposed to the American presence, the heterogeneous Mehdi army (or Jaysh al Mahdi, JAM for short) was never primarily, or consistenly, a proper Shia insurgency. After staging two uprising in 2004, which the Americans put down after some hard (if lopsided) fighting, direct confrontations subsided. JAM insurgent activity was minor compared to attacks by Sunni groups until late 2007, which is also when the EFP started appearing in greater numbers. Indeed, most of JAM spent most of its time either ethnically cleansing Sunnis in eastern Baghdad or running various criminal enterprises, rather than fighting the US. Mind you, the Sadrists are extremely nationalistic and no friends of the Americans (their rank and file are also far more anti-Iranian than, say, Badr cadres). But it is a different dynamic from that of Sunni insurgents. First, JAM has more of a return address, or at least has arrestable public faces and some physical infrastructure. Second, they have a constituency which demands protection from AQI tender mercies and goodies from their patronage network. Thirdly, they are or were in the government."
On insurgent groups in general: "JAM is not beaten, but it has taken a beating. Unlike AQI, however, it still retains substantial popular support. As I will attempt to show, the most significant factor determining what happens next in Iraq is whether the Sadrists and the remains of the Sunni nationalistic insurgency, who are currently marginalized by the central government, can be brought back into something resembling a political and social compact.
For a decent outcome to happen, it is necessary that these outsiders be given enough of a stake, both in terms of government services (or, more realistically, patronage), and political participation. In that regard, the obduracy of the Maliki government (by dragging its feet on the hiring of Sunnis, or in providing them with governmental services) is probably one of the most worrisome (and intractable) problems in Iraq today.This is compounded by widespread corruption, and the absence of a competent civil service or a functioning civil society."
On the future: "Much will depend on the manner in which the upcoming provincial, and later national, elections are conducted. If popular groups or individuals are excluded, or if there is significant vote rigging or voter intimidation, the Sadrists and the various Awakening/Sons of Iraq/etc groups will probably abandon the political process altogether. A fair and well-run election on the other hand will bring into the political process these outsiders and sweep away many of the currently underperforming insiders. A blatantly rigged or eternally postponed election will probably push said outsiders back to a new insurgency, and will lead to either a resumption of the civil war or (more likely, in my view) the imposition of a Dawa/SIIC/Kurdish co-dictatorship."