There are a lot of angles to answer that question. Many of them were supplied by caretaker Iraqi Prime Minister Adel Abdul-Mahdi who tried to let the world know through official (and unofficial) channels of the extent of the pressure he was under by the U.S.
In short, President Trump was engaged in months of what can best be described as gangsternomics in directing the course of Iraq's future economic and political development.
My initial reporting on this should be considered, at best, informed speculation.
Did Trump openly threaten Mahdi over this deal as I covered in my podcast on this? Did the U.S. gin up protests in Baghdad, amplifying unrest over growing Iranian influence in the country?