@SW1amp
Ironically, if you go back to the roots of the Taliban as a terror organisation, it was when the west (US especially) supported them to fight the Russian invasion of Afghanistan when the USSR was trying to enlarge the grip of communism
The Taliban were the ‘good’ guys because they weren’t communist, so their extreme religious ideology could be overlooked or minimised
This isn’t quite correct. The Taliban formed after the soviet-afghan war. During the war the US and KSA financially and militarily supported the Mujahideen. There were seven main Mujahideen parties but not all backed by USA/KSA. Non of these were the Taliban however the Taliban did form links with some of the key members of this group - particularly Jalaluddin Haqqani (whose son is currently v senior Taliban)
Two of the seven accepted “Afghan Arabs” ie foreign fighter - including bin Laden - to join them. Because bin laden was so Rich (his father billionaire businessman) he was able to supply funding to the fighters. He ended up forming his own group - al-Qaeda.
But at end of soviet war, where the seven parties had been fighting in same side ie to get rid of Soviets, once Soviets left they all started vying for power. The country descended into huge levels of violence and tribal feuding with children being horribly abused. This is where Taliban stepped in
Taliban formed in Pakistan (near Afghan border) and were basically students from “Madrassas” - schools which teach fundamental Islam (again funding received from KSA but to my knowledge not USA). KSA is lead by royal family, however they are beholden to Wahhabi clerics who want to see as much fundamentalist Islam as possible, hence the KSA support). Once Taliban formed they started to take control - initially in south of Afghanistan. At that point because of the levels of violence being committed by feuding warlords, many people actually welcomed the Taliban as they very quickly reduced these levels of violence (by their brutal punishments as we all know about).
They gradually took over the country (complete control ~1996) but despite the mounting evidence of their oppression and brutality, the USA did not object to them being in power (interestingly there was oil involved - lookup Afghan oil pipeline). The Clinton administration turned a blind eye to the human right abuses.
In late 1990s al Qaeda emerged as a threat - embassy bombings in Kenya and Tanzania. Al-Qaeda were based in Afghanistan- something the Taliban allowed, but there was always a bit of a power struggle. But after the bombings and the fact the Taliban wouldn’t hand over bin laden, the Clinton administration then decided Taliban were not acceptable.
Then 9/11 happened and with Taliban still refusing to hand over bin laden, war started.
Sorry this is so long and I should say I’m no historian and I’m only repeating what I read from books. I may not have got everything right, but my main point was - the USA/KSA did not find the Taliban during the Soviet-Afghan war.
Final point: the key country involved in all this is Pakistan: their military and security service (ISI) essentially protect the Taliban (and protected bin laden) so even when the civilian Pakistan government want to crack down on Taliban, they are not able to. Pakistan’s role (alongside China as has already been pointed out) is going to be fundamental to getting any form of resolution in this area.
It is an utterly desperate situation.