> This is why Afghanistan, in terms of outcomes, is essentially the strongest military nation in the world. They've defeated both the US and the USSR in spite of being orders of magnitude behind in every single measure of military strength - except for morale.
The problem is, in Afghanistan the Western nations didn't do much else than depose the Taliban that took around two years and provide education abilities for women afterwards. But in order to actually achieve change, you have to invest significantly more resources to actually build the foundations for a viable society: democracy, rule of law and an economic perspective for the populace.
In Germany, the Allied Forces stayed for about 45 years, two generations worth of time. Just think of the massive amount of money and resources invested... the first years were taken similarly to Afghanistan - depose the Hxtler regime and rebuild a rule of law afterwards and, as in the Luftbrücke, ensure basic survival. But then, they stayed in for over three decades to make sure that a healthy democracy would not just form but also establish and entrench itself against threats, and that Germany had an industrial base which was used to provide employment and income for the populace. Also, thank God for the Americans deciding not to follow the "Morgenthau plan" that proposed turning Germany into a purely agrarian state with no industrial capability ever again - that would have caused us to follow down the Afghanistan path with utter certainty.
In Afghanistan however, the situation after the immediate war and short post-war period was markedly different. The troops were locked up in their bases outside of bombing jihadists, which meant that local warlords had little to no oversight in their atrocities and stuff like "bacha bazi" (organized child sexual abuse) and slavery went on with effective impunity. The local puppet government barely had any income sources other than foreign aid (and selling opium on the black market) which meant there was no way to form a national identity and storytelling or even a common purpose, and a lack of oversight of the occupying forces over the puppet government led to widespread corruption and looting of the external investments, which led to it losing support across the country. And on top of that, we didn't even do decent oversight over our own troops. Abu Ghuraib is far from the only scandal that was barely prosecuted, not to mention all the other shit that was quietly swept under the rug - that led to the populace despising our troops even more.
We didn't lose Afghanistan because the Taliban are a strong army - they were and are not, just look at the videos from right after the takeover. We lost Afghanistan because we didn't give anyone in the wide population a reason to fight for themselves and not just submit to the next best warlord.