TX radio probably comes closest as to why the fall happened so quickly.
My take:
I reckon the lion's share of Afgans are muslims. How many are not?
As are... the taliban. Radical muslims, yes, but muslims all the same.
And what were WE?
Why, "kafirs", of course... infidels.
Infidels are and remain infidels, to both moderate and radical muslims.
Infidels, fighting against... islamics.
To make matters worse, at the end we became "woke" infidels, forcing upon the Afghans such things as transgenderism, symbolized by the "rainbow flag".
Perhaps Afghans were just tired of the infidels, and actually believed the taliban might offer a better alternative.
Kinda like the American fools who, tired of Mr. Trump's "mean tweets", believed ol' white joe would be a better alternative.
And now, BOTH countries are collapsing...