>>2189691>from 2001-2021 in the first placeThey weren't. Pakistan supported islamists behind the curtains to deflect them from its own more secular gov with US as an ally during the cold war, effectively exporting them. When cold war was over Taliban inevitably turned against Pakistani because there were no more enemies of Islam except neighbors. Separation of Pakistani Intel from overseeing groups like al qaeda slightly predates 9/11, which is also evident.
Also you must know that despite lines on the map the pakistani/afghan border practically doesn't exist and governed by local pashtuni, which generally aligned with Taliban as its originated from that region.