What has happened by the US government via Biden is that he and his administration saw that the Afghan military effort there is becoming a lost cause or a cause which made it necessary for the US to stay there indefinitely.
Essentially a controlling police force which was costing the US in money and lives, because the Afghan government wasn't strategically make grounds to govern over the nation themselves, such as banning the Taliban's active existence inside the country.
In my opinion the only active way to ban the Taliban and make it disappear is to capture and execute anyone who associated with this group/organization. Really put the fear into people to change their minds reconverting the population to more updated social standards in regards to human rights etc..
Sounds a bit brutal and backward yes but fear does work to change people's mindset about ideologies, particularly long held ideologies that offer men more power and control for their own sake.
Sadly any gains that country achieved over the past 20 years is going to be ruined, refugees into the thousands are now making their way into neighboring countries.
Who's to blame for this redundant misstep ?
I think mostly the Afghan government with the US and associating governments ie. Canada facilitating the whole affair being used and exploited toward a means which realistically was never going to be achieved by their staying presence.