In February 2020, Trump struck a deal with the Taliban to free 5,000 prisoners and leave by 5/1/21. The Afghan government was not invited to these talks by either party, despite controlling Kabul.
Between February 2020 and January 2021, Trump evacuated about 11,000 of the 13,000 troops, but insofar as we know, 0 civilians. Also left behind, an unknown amount of equipment as of 1/20/21 that had to be out by 5/1/21.
When Biden came into office, there were 2,000 troops left in the country, but an unknown amount of equipment; all the translators, the refugees, aid workers, and civilians were still there, leaving Biden with the task of evacuating 100,000+ disparate people across Afghanistan in just three months, in the middle of a civil war.
So Biden negotiated an extension to give us time to get as many of those scattered people out of the country as possible, since Trump had not for unknown reasons. The hasty mission had security flaws, which even an additional 5,000 troops could not fix in a country of 30 million people, 4.4M of whom live in Kabul, where the Afghan govt made its last stand in the civil war, without US help.
Had Biden not negotiated the extension, virtually none of those 100,000+ who were rescued in the airlift in Jul-Sep 2021 would have escaped by May 2021, since Trump apparently had no plan to withdraw them.
Biden didn’t fuck up the withdrawal; it was already fucked by Trump’s laziness and indifference.