3 star general who was there during the final months has some interesting takes, he goes into detail on these three:
First, former President Donald Trump’s
February 2020 peace deal with the Taliban in Doha doomed us. It put an expiration date on American interest in the region. Second, we lost contractor logistics and maintenance support critical to our combat operations. Third,
the corruption endemic in Mr. Ghani’s government that flowed to senior military leadership and long crippled our forces on the ground irreparably hobbled us.
It pains me to see President Biden and other Western officials blame the Afghan Army for collapsing but not mention why that happened.
www.nytimes.com
And for those that hate my opinion, it says "Biden ignored conditions on the ground".
IMO Biden's only option would've been to keep us there longer, with no actual guarantee that any eventual withdrawal would've been any less messy.