It is in the interests of both America and Iraq that US forces withdraw from Iraq.
America cannot defeat the insurgents completely with reasonable and acceptable costs. So it has to leave.
For Iraq, any internal problems will have to be resolved by themselves and the US presence cannot help them to do that. Sooner or later they have to find a balance and compromise between different ethnic groups and factors, including possibly insurgents.
In hindsight, the Iraq war has done more damages than good to the US, not to mention the huge damages to Iraq.
A lesson from that war is that the US can do a lot of damages to another country, if it just strikes, and leave shortly after a military victory or do not entre that country at all.