IIRC...
Back then, our military wanted to leave a contingency of troops.
The Iraqi people wanted our troops to stay for protection. They said the terrorists would take over if the US wasn’t there.
Obama wanted to reduce the amount of troops. The Iraqi government was being taken over by (use any label here) and they said they wanted all troops out.
Obama changed course and went for a complete pullout.
The ‘assurances’ thing is just an excuse.
As for Maliki, he had been wanting to minimize the Sunni influence in the government since he took over, but with the US there he was held in check - the day after our last troops left, he had the Sunni vice-president arrested on trumped-up charges, and continued the purge of Sunnis including many of the best-trained army officers after that - without the leadership our military had helped develop and without our direct support in the field, it's no surprise the Iraq army virtually collapsed in the face os ISIS - Obama will never admit to the harm he has unleashed after the US had, in his own words, brought Iraq to a "sovereign, stable, and self-reliant" state......