It's complicated, and while I have some experience in the AO, I don't pretend I'm an expert on Pashtun culture. I have worked with the Afghan National Army (ANA) a bit. So here's a brief overview. I'll give you the highpoints so you can at least see why none of the US military is particularly surprised.
1. A lot of the ANA IS the Taliban. It's not so much the ANA is folding, as some of them are just changing their uniforms and continuing. Many of the ANA had been with the Taliban during the 90's and their fathers had been with the Mujahideen during the 80's. When we invaded in 2001, and ramped up in 2002 these folks saw the writing on the wall, and left the Taliban to the real screaming beards and tried to carve out a place with some power in the new government. Now that the new government is collapsing they are ditching the ANA and trying to carve out a place with some power in the new government. This flexibility with allegiances is one of the reasons we had so much issue with green on blue attacks while we were there. If a dude is only sorta behind the ANA, and you blow up his third cousin's produce stand, he may very well try to take some US forces out in retaliation.
2. Tribalism. This is a big one. It's hard to fully understand how the entire Pashtun culture revolves around your tribe, and your tribe's fortunes. Americans think of them selves as American, even Antifa sees themselves as saving America. There isn't really an Afghan national Identity until an outside force attacks, and even then it's much weaker than most westerners can really fathom. Young men join the ANA because their tribe needs them to, or they need to steal equipment or get training for their tribe, or to get access to a different tribe to settle a score over three dead goat from 1982. No one joins the ANA to protect "Afghanistan". So if you are Karlanri from the southeast, and happen to be with the ANA outside Lashkargah (Helmond province) and the Taliban are rolling up it's very, very likely you'll see that as a Durrani problem and just go home. It's also likely that if you are careful and pick the right part of the Taliban lines to cross, your cousin will let you take your weapon and go home. Even the idea that there IS an "Afghan National Army" is misleading, because it implies more cohesiveness than really exists. For that matter "Taliban forces" implies more cohesiveness than really exists. There's a small group of screaming beards and a nucleus of folks running a Jihad, and a bunch of other folks that are willing to be steered (a little) in exchange for weapons, money, and the promise of local control when the dust settles.
3. No one likes the Afghani government. We didn't really understand the Pashtun when we started (I would argue that State still doesn't) so when we thought we were setting up a more stable, democratic(ish) government what we actually did is enable one set of corrupt tribal leaders to pick a small group of friends and run roughshod over their rivals, with NATO acting as hired muscle. Like suddenly rich corrupt officials the world over they got a little out of hand with their grift and corruption, even by southwest Asia standards, and made some enemies. Even among the folks that aren't enemies, per sae, much of what the central government does is distasteful and embarrassing to the tribes. One is not likely to risk a whole lot for a government they don't really like anyway.
4. The screaming beards and their true believers are brutal as *expletive deleted*ck. From a purely practical standpoint if a Taliban milita rolls up to your village, and you slap burkas on your women, thanks them for rescuing you from the imperialist's, and give them half your crops and 20 or 30 third cousins to join the milita, they will probably roll on down the road. If you fight, they will rape and kidnap the women, hang the elders, draft all the boys for suicide missions, burn the village to the ground and take all the crops. With it being clear the US won't help them, why would they fight?
5. Inshallah. The ANA is not a professional fighting force (even when they decide to stay and fight). Americans have this idea that the army is a group of people that make warfighting and winning their profession, and work to master that profession. Western Militaries all tend to do that. We take the "warrior" mentality and hone that. We spend MASSIVE amounts of money to let huge armies sit around and just get better at fighting for decades between wars, or for that matter during wars. The US Army in particular is the best in the world at multi domain conflict because we spend a lot of time and effort at being such. While the Warrior archetype exists in the mideast, it's not our Spartan derived professional soldier. It's more of a lone warrior with God's favor type thing. (and I'm still not really conveying the archetype well).
You fight your hardest, and if you win, it was God's will, and if you lose, that was also God's will. Better equipment and tactics won't help you win if it's God's will you lose, and if it's his will you win, you will even if you use rocks. So why bother with all the hard work of endless training, and discipline. In fact, if you do bother with all that hard work, it's like you don't trust God to have you prevail. That lack of trust in his will is likely to turn him against you and yours. You fight, someone wins, Inshallah. Who are you to try and change the ordained outcome by being a better fighter?
Even that is an oversimplification, but the attributes that the Western militaries think make for a good soldier and army are actively avoided by most islamic armies.
There's more levels to the Afghan cultural onion, and I'm sure there's parts I still don't fully grok, but those are kinda the main themes driving why the Taliban forces are not having any real issue with the ANA, despite the ANA having numbers and billions of dollars in US hardware.
I'm wondering if we shouldn't have just colonized the place for real instead of half assing it. I'm sure we'll be back in my lifetime, if not in my Army career, although I heard rumblings that Putin would impose order if he needed to to secure the pipeline networks through the Caspian Sea, Turkmenistan, and Uzbekistan. The Russians are welcome to take their shot for a decade or so.