Read Strategypage's assessment:
With the disruption to the drug trade in southern Afghanistan (Helmand province and around Kandahar), the Taliban are seeing less cash from the drug gangs, and growing hostility from tribesmen that formerly supported them. The Taliban had always sought to be feared more than loved, and these reverses have driven them to use more terror than ever before.
We are hurting the enemy and we can beat them in the field. And as long as our objective isn't to create a strong central government to rule Afghanistan, we will defeat the enemy and win this war.
It is true that al Qaeda could set up shop anywhere, so in theory al Qaeda doesn't need Afghanistan as a base to attack us. But the simple fact is that the Afghanistan Taliban are al Qaeda's ally. Al Qaeda is in neighboring Pakistan making it far easier to just roll across the mountains into Afghanistan rather than any of those other theoretical sanctuaries. Further, a Taliban win in Afghanistan will encourage the Pakistani intelligence people to ramp up support for the Afghan Taliban. And the Afghan Taliban will regain the support of a sanctuary in Pakistan as the Pakistanis back off suppressing their own borderlands Taliban.
And if you can still sleep at night at the wisdom of withdrawing and counting on us being able to sledge hammer any jihadi training camps that arise after we withdraw, the jihadis will have the potential powerball of seizing control of nuclear-armed Pakistan in their attempt to win the caliphate lottery and run the Moslem world.
The enemy has problems. So do we, to be sure. But for the most part, their problems are worse than ours.
Except for one, unfortunately. If we believe we are doomed to defeat, that problem will trump all our advantages over the enemy and make all their problems trivial as long as the enemy thinks they can hang on long enough to wave goodbye to our last troops sent to hunt them down.