Afghanistan is different because you are trying not to let the extremists get their claws into the ordinary people. People who would rather be off herding their goats not worrying about stepping on a landmine or having their homes raided looking for weapons or having a Paveway drop in on their son's wedding. When the Taliban first came to power they were welcomed as bringing a measure of stability and purity, a change from the old corrupt Soviet puppet government and the warlords. They weren't widely loved but they came to be feared. That's what we risk happening again if we abandon the country, it will lapse back into a medieval theocracy where the Islamist extremists will once again find friends in the government and establish their madrassas and training camps unhindered. What then? Invade the country all over again?
Might it be a better idea to marginalise the extremists, deprive them of the hearts and minds of the people so they, not us, become the outsiders. You can take out a few loony beardies a lot easier than taking out a whole population or world religion. Afghanistan will be the tipping point, where we either win or lose the battle of philosphies.