https://en.wikipedia.org/wiki/United_States–Taliban_deal
Negotiated for the U.S. by Zalmay Khalilzad for the first Trump administration, the negotiations for the agreement did not involve the Islamic Republic of Afghanistan, the Afghan government at the time.[4] The deal, which also had secret annexes, was one of the critical events that caused the collapse of the Afghan National Defense and Security Forces (ANDSF).
Insurgent attacks against the Afghan security forces surged in the aftermath of the deal, however, with thousands killed. Regardless, withdrawals per the agreement continued. By January 2021, just 2,500 U.S. troops remained in the country, and NATO forces fully evacuated by the end of that summer. The U.S. completed its full evacuation on August 30, 2021, as the Taliban took control of the country by force.
Trump, the ultimate deal master, gave the Taliban everything while not involving any of the Afghan folks who weren't Taliban that we'd been working with for years. The Taliban then, of course, waltz in, killed a bunch of people, and took over everything.
However, in the aftermath of the agreement, the U.S. stopped supporting the Afghan military in its offensive operations, forcing it to take mostly defensive positions around the country. According to the agreement, U.S. military aircraft could not attack Taliban groups waiting more than 500 meters away, giving the Taliban an edge in targeting Afghan military units.[citation needed] The agreement also exacerbated the decline in morale of the Afghan army and police, making them more open to accepting bargains with the Taliban. Due to a lack of information and secret annexes in the agreement, that had not been shared even with the then Afghan government, the Taliban were able to spread propaganda and disinformation about the agreement, including convincing local police and military units that the U.S. had handed over territories to the Taliban and that they should abandon their positions.[51]
In the 45 days after the agreement (between March 1 and April 15, 2020), the Taliban conducted more than 4,500 attacks in Afghanistan, an increase of more than 70% compared to the same period in the previous year.
So basically, Trump completely abandoned our allies in Afghanistan like this shooter. He allowed the Taliban to go hog wild and kept American forces from fighting back. He pulled the large majority of our forces out which essentially handed the entire country over to the Taliban. The Taliban kills swathes of Afghan military forces and people from the government while we sit and twiddle our fingers. Those guys, predictably, then say fuck this shit and bail or start switching sides. Then Biden got stuck with the mess. By the time Biden took office there were hardly any American troops left, the Afghan forces were in complete disarray, and the damage had already been done. At that point there was nothing to do except pull the few remaining troops out and leave all the equipment Trump didn't bother to tell the Pentagon to remove beforehand.
So the Taliban got to keep a bunch of the equipment we abandoned. Which is where you get videos like this:
Art of the Deal, baby! We get nothing and our enemies get everything! Oh, and the poor, stupid idiots that thought we were actually going to have their backs and who believed our bullshit got ruthlessly murdered. Ah well, thems the breaks!