I'm pretty sure we invaded Afghanistan because the Taliban were literally harboring Bin-Laden and refused to hand him over to the US for trial, it wasn't a "pretend" war, over 3,000 people were killed including 67 Brits in a terrorist attack which caused the US to invoke article 5 of the NATO treaty.
I fear we're completely doomed to witness history repeating again and again.
Once they have Afghanistan back under their control, and a safe space for their training camps, etc, then the next objective as always is renewed operations against other nations, including the West.
These people literally will not be happy until the entire world is living under the strictest form of shariah law.
That's not to say I agree with our invasion of Iraq, Afghanistan, etc. Because I don't. But this cancer is going to fester and spread, and there appears to be very little way to deal with it. By all accounts, these extreme islamists are well-supported. Including by large parts of the general populace. What can you do about that..