Assad regained rule of Syria and doesn't favor Sunnis, while the Shia still govern non-Kurdish Iraq and favor their own. The substantial numbers of Sunnis in both countries implicitly believe they should be favored or, put another way, should not be second-class citizens.
Thoroughly Sunni ISIS offers a mailed fist to be wielded on behalf of downtrodden Sunnis. Our helping various local actors bash ISIS when it was a 'caliphate' controlling territory didn't change any of that.
The human condition faces problems that can be cured, like TB or pneumonia, and others that can only be treated, like diabetes or body odor. ISIS and the like are a chronic condition that will continue to arise as long as the conditions which enable it to give hope to Sunnis continue to exist.
This side of the grave, there is no cure. As President Trump said of Afghanistan, "I could win this war but I don't choose to murder 10 million people. " The same is largely true of ISIS and Syria.
David Goldman, aka "Spengler," wrote something similar about unrest in the region in 2014, likening it to the Thirty Years War.
Three million men will have to die before the butchery comes to an end. That is roughly the number of men who have nothing to go back to, and will fight to the death rather than surrender.Goldman is a little ray of sunshine, isn't he?