Before 2001 Iraq was a Ba’athist dictatorship dominated by a religious minority.
Neighboring Syria was also a Ba’athist dictatorship dominated by a religious minority.
In 2002 Iraq was invaded by the United States and the regime overthrown, but Syria was left alone.
Now here we ar,e with both Iraq and Syria having lost a third of their territory to the ISIL religious extremists.
In science you test theories by taking two identical examples, applying a change to one and seeing how the two are different as a result. It is rare in geopolitics where you have a situation that resembles a scientific experiment, but Iraq and Syria do. The results show that invading has made no difference in preventing extremists from taking over part of the country. Of course in a proper scientific experiment this test would be run multiple times to get statistically significant results.
The reality is the rise of ISIL was primarily triggered by the Syrian civil war, which was triggered by the Arab Spring revolutions. Had the US not invaded there probably would have been an Arab Spring uprising Iraq as well. It’s hard to predict if it would fizzle out, like in Iran, or lead to a civil war, like in Syria or what actually happened after the US invasion. ISIL may well have ended up taking over the same territory as they have now.
It is easy to forget these groups true aim is to impose their morality on Muslims in the Middle East. They are only attacking the West to provoke us into responding militarily. If we didn’t get involved they would be trying harder to provoke us or using a different tactic.
The rise of ISIL was an unintended consequence of the Arab String, which started off as a good thing, but went off the rails as revolutions have often done since the French Revolution. Its connection to the invasion of Iraq is tenuous.