We legitimately did a garbage job. The folks we put/kept in power were fucking horrible, and the shit just kinda' rolled down hill from there. Part and parcel guerilla fighting doesn't see complete collapse like we've just seen in Afghanistan; this was a special breed of twenty year, two trillion dollar fuckup.
Setting aside the insanity of us still being responsible for who is in power in Afghanistan.....
US generals tried to fight it like a war. This is why soldiers do not make good policing forces. Watch Restrepo. See what those guys were dealing with. It's either sit on a hill and let the Taliban snipe/mortar you, or go village to village and get ambushed possibly by the very people that invited you there, or carpet bombing air strikes on the mountains against cave strongholds that legitimately can't be reached by such weapons. The US military and its operational methods work best against a static enemy with large numbers of troops. It's not suited to dealing with hundreds of groups 4 to 5 people strong scattered across the country side, who attack targets of opportunity or isolated patrols that have been fatigued from months in active duty and let their guard down. And really, that's what any trained Afghani soldier was going to be doing...they were just going to be worse equipped and trained than an American soldier.
We should have never been there in the first place. But I hate the back seat condemnation of US forces like this is somehow unique to us. NO ONE HAS EVER SUCCEEDED IN AFGHANISTAN. Not us. Not the Russians. Not the British. Everyone has been chased out and ground down by attrition, trying to eradicate an enemy where they live and who create martyrs and sympathizers with every body that hits the ground. It was the same in Vietnam, trying to save the very people who want to kill you. Historically, you either kill 80% of a population or interbreed for 4 generations when you want to conqueror a people. No one outside Afghanistan actually wants to live there, they just want to own it and since we're first world nations for the most part, just murdering anyone who disagrees isn't an option either.
You know who it IS an option for though? The Taliban. The only way to truly win against them is to be just as ruthless as they are, and we only engage in that sort of behavior in fits and starts in isolated incidents where both troops and commanders have finally had enough and commit some war crimes. Which immediately turns many Americans against the war effort as it should.
Again. We should have never been there in the first place. We were never going to "win", and propping up a regime for decades didn't work either. And frankly, "democratically free Afghanistan" was what they used as a reason to get support from half the country for it. The other half was pure "let's kill some fuckin terrorists for 9/11." They got their vengeance, we killed Mullah Omar, we killed Bin Laden, the Taliban got a little weaker for a time and then the rest of the misery was left trying to convert another nation across the world populated by many people that hate our guts back into a democracy. The kind of thing that people with good hearts who want to see women be their own masters and other democratic ideals support. As noble as that is, it's the reason we've stayed in Afghanistan at such a cost. It's strategic value has been diminished, we've shed all the right blood for people wanting vengeance, we've enriched our military contractors and "the complex", we've done enough to say "we tried" to the rest of the world.....the desire to remake Afghanistan again into something else is the reason we've stayed, and to me, it's just not nor has it ever been our business trying to make space for other democracies to grow. Even if it's morally the right thing to do to me, it is impossible to justify the cost.
Iraq has teetered on this knife edge for years as well, and I think the only reason we haven't fully given up there too is because it simply has more economic and strategic potential than Afghanistan.