Before I start and if you have the time then listen to THIS which is late night live special on the Taliban.. ( the first 15 minutes is talking to a afghani journalist who has fled the country and then we have three people talking about the taliban now. did you know NGOs have led education programs for girls under the taliban!
Now read THIS. Only small on ISIS-K.
Now to the topic. I am baffled why no-one has brought up why Afghanistan which had a legal basis for invasion and not Iraq which did not. Are the US scared of leaving Iraq because it's relationship with Iran. no US forces would not mean a vassal state but it would mean a much closer relationship. A sanctions busting relationship??
Thus I am of the opinion the US should get out of Iraq before Afghanistan.
In terms of Afghanistan the original basis was fine. Al Qaeda which produced 9/11 ( 11/9 actually) had its bases and organisation there. Indeed it should have been utterly destroyed except for incompetence.
When you invade a country then you have a responsibility to build a nation. This is a secular response. A Christian response goes even further. No President took this responsibility seriously. Thus we can say no President ever gave a stuff about ordinary Afghanis. They made no attempt to build institutions which are necessary for democracy and capitalism to flourish.
The next problem is if you say you are leaving then leave cover for the Afghan army which relied on air superiority. It is no surprise if you provide no air cover and the soldiers are not getting paid they do not want to fight.
The USA should have build up Afghanistan so the government would never be toppled. Biden and the three Presidents before him all bear responsibility for this. The policy has always been incoherent.
I should have added I hope the taliban is not treated like Hamas. Hamas easily won an election but Israel refused to recognise them. Israel influenced other governments to do the same thus the 'real politik' faction lost all credibility and Hamas simply turned into the organisation they are today (and what Israel wanted.)
If you listen to the audio then you will know the Taliban has a similar 'real politik' faction. Add to this they crave international recognition then the best option is to help them at present. They are not good guys but they need certain skills, money etc . Help them and see what occurs. After all if the taliban do not change then you can impose sanctions etc