The worsening of the TTP insurgency in Pakistan is a direct result of the Taliban's takeover of neighboring Afghanistan. Though the Taliban may claim that it can be trusted to secure the border and strengthen the security situation in Afghanistan, it's a direct ally of the TTP and is likely supporting its attacks in Pakistan. The TTP, which has long taken refuge in Afghanistan, has benefited from the Taliban's return to Kabul, as it can now freely launch terror attacks into Pakistan.
Restraint is necessary on both sides of the border for an effective and just solution to this dispute. Both Afghanistan and Pakistan benefit from cross-border trade, and closing the border helps no one. The Taliban should take a stronger stand against the TTP, but Pakistan must also allow sick Afghans to cross the border. Neighbors should work together toward mutual benefits.
There's an 86% chance that Pakistan will recognize the Islamic Emirate of Afghanistan before 2030, according to the Metaculus prediction community.