ISIS was never defeated.  The press keeps insisting that ISIS is staging a comeback but it was never defeated.  Ali al-Sarraf (THE ARAB WEEKLY) observes:
Is there something more revealing of the nature of the Iraqi regime than the Islamic State?
Everybody is saying the Islamic State (ISIS) is “making a comeback.” 
ISIS had never left in the first place and it was not defeated. The 
mechanisms responsible for producing it have continued to spin without 
interruption.
Despite the collapse of ISIS’s self-proclaimed caliphate, no one 
dared say that a definitive victory was achieved over this organisation.
 There was no official announcement to that effect and the field 
commanders could still smell the presence of the enemy even though they 
did not see it or dared track it.
Wherever ISIS went, there was devastation. That’s hardly surprising 
and would not have changed anything coming from an organisation whose 
strategy is based on destruction.
Similarly, as long as there existed militias created and supported by
 Iran for the purpose of sustaining corruption and desolation, it was 
only natural that there would be militias that do not find it difficult 
or fearful to produce devastation everywhere.
The ISIS “production machine” has never ceased operating. All that 
the war on ISIS did was to destroy some of the “goods” that came out of 
the production line.
ISIS was not defeated.  All those bombings, all the destruction and it accomplished nothing.  Well, nothing worth praising.  Mosul was destroyed in the bombings.  And today?
Osama Bin Javaid (AL JAZEERA) reports:
Two years after ISIL was evicted from Mosul, the city still struggles
 with electricity, water, healthcare and other basic services and 
reintegrating close to half a million people has been a slow 
bureaucratic challenge with thousands having lost identification papers 
and other important documents during the war.
People in the city are saying that it will take a lot of effort to rebuild Mosul, and they will need international support, too.
With the totality of the destruction, many have tried to rebuild, given up and left, but still others are determined to stay.
The Iraq War, nearly 17 years later, has still not been won.  It never will be.  How many more lives and how much more money will be wasted to continue this never-ending war that accomplishes nothing?