The withdrawal was signed and sealed by Trump, who was the one who apparently believed the Taliban (or else knew he'd be leaving a poisoned chalice for his successor). Biden had no choice about it, though he delayed as much as he could.
In February 2020, the first Trump administration and the Taliban signed the United States–Taliban deal in Doha, Qatar, which stipulated fighting restrictions for both the US and the Taliban, and in return for the Taliban's counter-terrorism commitments, provided for the withdrawal of all NATO forces from Afghanistan by 1 May 2021. At the start of the Biden administration the following year, there were 2,500 US soldiers remaining in Afghanistan; the other ten thousand plus had already been withdrawn by Trump. It is worth noting that Trump didn't think the government of the country worth including in his "deal" with the terrorist organisation opposing them.
Biden managed to hold off the full withdrawal until September, but Trump had already signed the agreement and started to get the American troops out of the country.