Another issue seems to be that what we left just wasn't even sustainable.
For example, the ANA is often, and fairly, criticized.
-But when their civilian leadership (Ghani) ignores military advice and orders them to take a stand at remote locations while failing to even resupply them with things like ammo so they can keep fighting, that's difficult to overcome.
-And if your system is so corrupt you don't get supplies (food, fuel, ammo, etc), or they actually end up in the hands of your enemy, you simply can't fight through that.
-They also took a very high number of casualties over the decade or so of being pushed into the lead of operations. They actually lost more fighting than they actually probably really mustered at the end (estimates seem to put the actual ANA force level at ~10-30K, rather than the 300K they carried on paper). This isn't to make the case they were exceptionally heroic...but it kind of makes the point that you can't sustain a force over that pace of operations when your loss to (actual) force level is that high. At the end, the Taliban were likely probably better able to rest and retrain their fighters than the ANA was.
I'm coming to some very weird mixed feelings about Taliban 2.0. And this has forced me to really re-process several things that I've been aware of over the years, but never actually put together since we pretty much took our attention off Afghanistan (even more than before).
One of the biggest things that I think got lost over the years, and especially in the transition between Administrations, was that we seem to have stopped looking at the Taliban as "the enemy." It's a very difficult change to try and culturally process, when you associate them with 9/11 and especially if you were part of directly fighting them for almost 10 years. But as early as 2012, we were actively messaging that we were open to the Taliban being part of the Afghan process (ie democratically, not through force). And when we started to directly negotiate with them in the 2019 timeframe, that was another big step in pushing them towards legitimacy. At about the same time, I also recall we were actively assisting them in fighting ISIS-K forces in Afghanistan (through airstrikes). And finally, obviously, we came to our own negotiated terms with them, including freeing several prisoners one of who is now the....President of Afghanistan, I guess?
I don't feel strongly about any of that one way or the other...in the end it got the US what we wanted, which was an exit from Afghanistan.
What I think we failed at was actually processing that change that the Taliban became a de facto pseudo legitimate government body in Afghanistan.
And in behaving like a government, for the most part, actually appeared to stick to the terms of the Doha deal, to include not attacking US forces (think about the incredible C2 challenges and discipline required for an insurgency to ensure no random trigger happy idiot pops rounds off at US troops), to the point they were actually actively attacking local Islamic extremist groups that were attacking locations with US forces. This even continued when we resumed airstrikes on them for...whatever reason. Having taken Kabul, they've allowed foreign media to continue, they haven't mowed down civilians trying to flee, or apparently even clashed with US forces. They haven't interfered with the ongoing evacuation operations and in some ways appear to be contributing to stabilizing the situation. I'm still skeptical of what is happening outside the view of the cameras, but they have run an incredibly slick PR campaign. Seriously...these guys are not at all the same as what the world derided as "camel jockeys" in the early 2000's.
The point is, at some point, the Taliban became a real government, and flipped governance of AFG from the bottom up, from popular control of the rural areas (by actually providing better government at local levels) to the capital. The West, not paying attention to Afghanistan, completely missed what was happening over the past year or two, and we really never came to terms with that. So this is a huge surprise...but in many ways probably shouldn't have been.