It's been said that Afghanistan is easy to invade, but difficult to occupy. The events since about 1979 have seemingly reinforced this insight which originated from military history of Alexander the Great's era up to the 19th century.
The difficulties of occupation aren't actually that big, though. Even the not very lethal French Résistance was a much, much more lethal foe than the Afghan tribes or more specifically Pashtuns are or have been.
The frustrations are rather two-fold:
Occupation has little lasting impact. The Soviets' impact on society did not leave many socialist-secularist-European features intact in the Afghan society of the late 90's. I suppose the Western occupation and corruption of the country is not going to leave many desirable features left by 2020.
The other frustration is that Afghanistan is basically not worth it. There's nothing to be gained in this country. The British efforts of the 19th century paid negligible dividends. The Soviet efforts are widely considered to have accelerated the downfall of the Soviet system by their costs and demoralising effects. The Western efforts since 2002 have delivered about nothing. Some people talk about some paper tiger project of some pipeline and some mining operations, but those would be dwarfed by the occupation's expenses even if it had been in full operation all the time.
The Western military bureaucracies, military-related think tanks, authors and pundits have not addressed these fundamental issues much. Instead, they looked for some magic policy or strategy, often even tactics, to make Western troops more effective in such occupations. I don't doubt that defeating the Taliban is possible politically and at least temporarily also militarily. Their defeat wouldn't change the two aforementioned troubles, though.
The whole issue is symptomatic of small wars in general: The benefits are negligible, the costs of the operations vary, but maintaining the capability to play in such small wars without a dominance of improvisation is very expensive.
This could be considered a preferences-justified luxury if Western societies had a lot of excess energy.
Fact is, they are rather mature instead. The cake was already 100% distributed, almost all governments have net debts and many Western countries don't have enough capital investments to grow their capital stock (and thus their economic capacity) adequately. We are playing with camouflaged toys in marginal-dividend political games and neglect our investments in our future.
We shouldn't only invest more in our future - we should grow reserves to meet unexpected challenges. You know, back in the 18th century many governments were wise enough to have a state/royal treasure instead of a net debtor position. The only modern Western country with such a thing is Norway as far as I know.
For years I've faced people who wank off on fantasies about nuclear weapons, military or military budget sizes, big tanks, fancy combat aircraft, many warships, big warships, the ability to bully about anyone et cetera.
I did not meet or discuss many people who thought of the military as something that is easily justified up to the point of actual defence (preparations) and 100% subject to cost-benefit considerations beyond.* In fact, many, many people can't even tell that what they consider "defense" is actually strategic offensive action or capability. They mistake bullying, invading and occupying with defence. This confusion is a product of governments, of course. There are no war departments and more, but defense departments.
I propose (totally in vain, of course) to separate the discussions:
(1) Collective security topics
These would be about the deterrence or at worst repelling of overt aggression against our alliance only.
(2) Great power gaming topics
This would be about the excess military capabilities and their use. That's the bully, invade and occupy part. Anybody who muddles the water by calling this "defense" should be called out and rebuked.
This is 100% not going to happen, and that's a pity if not doomed to end in tragedy.
* Andrew Bacevich is a prolific author and commentator who gets this right.