I don´t know if this conflict become "unwinnable" due to a true incompetence, or it was "unwinnable" due to a deliberate incompetence because they didn´t have any interest in winning.
Incompetence played a role but apathy did an even bigger one. Few coalition nations are socially constituted in such a way martial success is a desireable entry on a politician's curriculum vitae; additionally, the sentiment Afghanistan isn't worth it or the job was done once Al-Qaeda had been ousted has always existed in the back of the minds of many. (Even though it should've been obvious a long-term presence had to be established to bar their
return.)
The primary issue on a political level is our democratic systems are not conducive to long-term undertakings. Not a single world leader who'd started this war is still in office. The temporal limitation of power in the shape of terms of office goads politicians into seeking short-term results over sustainable success. It invites them to kick the can down the road. They don't have to get the job done, as they won't be held accountable.
It´s difficult to bring an entire nation from medieval ages to modernity with only a military intervention and with a short/medium term plan.
You're right, and so are
@Chazman and
@Moose_Hates_You – but I'd go even further than you. I believe the twenty years we've been spending in that country could've sufficed had we used them to pursue a coherent strategy. We didn't. We squandered precious time away in a vicious circle of pursuing unattainable goals, hiding our failures, lowering our sights and adopting a new strategy.
A sociologist whose name eludes me at this moment established it takes but one generation for a polity to utterly collapse. A war that lasts longer than one generation is unlikely to end anytime soon as it has produced at least one generation that knows naught but war, derives its identity from it and lacks the socialisation necessary to live in peace.
But there's a curious example of a democratisation effort which should've failed but didn't: Japan. The atom bomb was used on Japan to no small part because many of the world's brightest scholars believed centuries of social imprint had rendered her people unable to return from the dark side, as it were.
The bombs may have precipitated the allies' victory, but America's success in reforming Japan is owed to a clever employment of the Japanese mentality and social structure to that end. MacArthur's refusal to unseat the Tenno and the respect he showed him achieved more than any number of occupation troops.
Likewise, we could've satisfied ourselves with helping the Afghans establish a regime more suited to their identity, i.e. one similar to Iran's (which would've been a great improvement to the women and the minorities of the country still, by the way).
And had we mustered the effort necessary to control the countryside, we would've enabled ourselves to employ the Afghan mentality to our advantage. The fact is, most Afghans don't care who rules over them – akin to how the serfs of old didn't care who their king was as their situation wasn't going to change: Their history has taught them to arrange themselves with whomever holds sway at the moment.
Had we held sway long enough, we probably could've stabilised the situation. We wouldn't even have needed to win the war militarily to accomplish this.
See, there's an anecdote about German general Markus Kneip (the same who got WIA during his second tour) meeting with a district elder back in 2006. The two men sat down, had what Kneip believed to be a fruitful conversation and the Afghan invited him to return on the very next day. Kneip didn't have the time nor the intention to visit again so soon; but he returned the next time he happened to enter the region: a month later.
However, the Afghan refused to receive him. The general was surprised since he knew this refusal to be extremely impolite by local standards, so he asked the elder to explain himself. He replied he couldn't risk talking to the Germans on one day if they wouldn't return the next day to prevent the Taliban from invading his home and punishing him for it.
Almost
four years later, General McChrystal recognised this. Taking a page out of Petraeus' book, he ordered everyone and their dog to go beyond the fence for a show of force. The successes spoke for themselves, but the press and the politicians interpreted the uptick in violence not as what it was (proof the Taliban were on the back foot) but as failure. This McChrystal criticised, and Obama sacked him for it.
It's a metaphor for this entire war.