From Pakistan's perspective, the Taliban were always an interim solution to a threat-vector on our Western Flank. Afghanistan before the Taliban was hostile to Pakistan. Since Independence, they believed that some of Pakistan's territory belonged to them, even though there's no practical basis for their argument. The biggest ethnic group in Afghanistan are the Pashtuns (15 million), but most Pashtuns are actually Pakistani (43 million). The minority population was claiming ownership of the majority. It was kind of like the case of the Taiwan government claiming 'ownership' of Mainland China.
Following the Soviet withdrawal, Pakistan obviously didn't want a return to the status-quo, and ceased the opportunity to secure its Western flank. We're already dealing with a foe many times our size on our Eastern flank. So Pakistan promoted a friendly group in Afghanistan, which was groomed in Baluchistan, funded by the Saudis and the US. This was the genesis of the "Taliban" (i.e. "student movement.") These guys were at least disciplined and united, and so easily swept aside the chaotic warlords of Afghanistan and ruled over their land with an iron grip. Most of their ways were rooted in ancient culture, not religion. They didn't care much for pan-Islamism or anything. They wanted to enforce their traditional culture primarily, and their own version of 'sharia'. There's a much larger issue here about how 'sharia' is really just corruption of Islam, where each sect and their local 'scholars' take only those parts of Islam which they want, and disregard the rest, trying to conform Islam to their local traditions (specifically, those exact traditions which the Quran is completely against.)
In any case, things may be different this time, hopefully. A new "Islamic Emirate of Afghanistan" was born on August 15. This marked the defacto end to a 20 year "War on Terror" (or as we Muslims saw it, another "Crusade"), took place on the following day of the 16th of August, 2021 (or the year
1443 in our Islamic Calendar.) The Taliban have shown signs that they are open to evolution, as evidenced by their recent statements, such the following:
It should be noted that they just won a 20 year war, that took the lives of over 150,000 Afghans, and could have easily decided to chop of the heads of everyone who worked with the Americans and go back to their ultra-regressive ways. Which army would stop them? But they have chosen to take a higher path in victory. That's a very good sign. I hope they continue down this path and wish their latest iteration the best. Happy Birthday Afghanistan (version 4.0.) You earned it.