Juan Cole with a useful Afghanistan post-mortem:
https://www.juancole.com/2021/08/washington-afghanistan-crashing.htmlHe equates the last 18+ years as a military/kleptocratic ponzi scheme.
He seems to underplay Pakistan's central role (and somewhat excuses it as a reaction to India gaining influence there). But overall a good primer on who the key groups were, what went wrong, and why it slogged on for decades (it was too lucrative for all the elites involved.
The one sure thing everyone knew was that the Americans (and allies) were going to walk away one day. Probably no one foresaw that being a full 20 years later. But the locals know they can always wait out and outlast the occupiers (the locals largely have no where else to go). Imagine being a 25 year old Afghani and all you've know your entire life is warfare and occupation and insecurity...