Strategypage addresses the Iraqi army's difficulties fighting:
This rapid and unexpected loss of Ramadi by a much smaller force (government troops outnumbered nearby ISIL gunmen by ten to one) brought forth accusations by the U.S. and other Western governments that Iraqis did not have the will to fight. That was not true and the real problem, as it has always been, is leadership. As the old saying goes, “there are no bad troops, only bad officers.” In late 2014 The U.S. reported that most of the troops they trained before they left in 2011 had since left the military and many of the replacements were poorly trained (and even more poorly led) by corrupt Iraqi officers appointed by the recently (April 2014) replaced Maliki government. ...
The basic problem was bad officers, in particular officers more interested in politics and getting rich (via corrupt practices) than running an efficient army. This is not a new or unique problem in the Iraqi Army. Since 2011 the Shia politicians running the government chose politically reliable Shia officers over those who were merely competent at their jobs. That led to the collapse of the Iraqi army in the face of a mid-2014 ISIL offensive. That should not have happened, but it did and will again unless the Iraqis put more emphasis on competence than political loyalty when selecting military officers.
I addressed this issue recently, since I am unhappy that the Iraqi ground forces are being scapegoated. Their supposed inability to be effective is being used by opponents of the war as an excuse to walk away again without helping them fight jihadis.
The Iraqis will never develop the military reputation of Prussia, but they can be good enough to defeat our common enemies if trained, well-led, and supported.
Let's help Iraqis be good enough to win this war. That's how you responsibly end a war.
UPDATE: And do remember, as it is all too easy to forget, that it is better to have an imperfect Iraq helping us kill jihadis than have Saddam's Iraq creating and supporting terrorists.