That the entire government of Afghanistan was going to collapse the nanosecond we pulled out was a foregone conclusion; the difference is that had we stuck to the timetable, not only would it have effectively given Trump the W after two decades of hand-wringing over it, but it would have effectively allowed the Dems to close the book on 9/11 instead. That shit would have been trumpeted to the heavens by the press, and it would have been the best opportunity for the Biden Admin to push its agenda.
The big secret is that the Biden Admin has been essentially out of political capital for some time. They did not get elected with a mandate; at best it was a hairline win. There is serious concerns about the administration's legitimacy, and doubts from both sides over the election. There are serious concerns over Joe Biden's fitness for the office, and that's not even getting into how his policies are wildly unpopular (no one sane wants lockdowns to return or vaccine mandates, but he's damn sure going to ram-rod them because it's what the elites want), the Biden Administration frequently make itself look bad (Jen Psaki is just the meme that keeps on giving), and are often at the point where no amount of spin makes it look good.
This is also why the Biden Administration's been so aggressive with shit it knows are going to get slapped down, like the eviction moratorium extensions. It doesn't matter if the shit they push gets stomped, they were trying to stall for time hoping the big win on Afghanistan would push them back into the green long enough to (hopefully) clinch the 2022 elections. They could assure that the press would only cover them positively, all they had to do was make sure that the retreat happened on their timetable and not Trump's.
They failed, as you've seen. They failed hilariously.