You have to understand where this sudden courage has come from. Pakistan is a country that was sleeping for the better half of the decade. Pakistan is a reluctant country most of the time. You will never see the Pakistani army attacking Afghan territory even when the opposite side has transgressed. Often the argument is that there are no winners. At best we see border closures for a few days. You ask yourself why suddenly such attacks are taking place. Wasn't TTP mounting attacks against Pakistan when the US/NATO were present in Afghanistan?
Ever since US/NATO left and made a deal with the Pakistani generals to look after Afghanistan you have suddenly seen an upsurge in attacks. This heroic fightback is due to Uncle Sam's permission. Uncle Sam has somewhat outsourced Afghanistan to Pakistani generals in their absence.
Just listen carefully to the spokesperson in the White House when speaking about the Pakistani army and generals. There is no more criticism. To the contrary, the Americans want to suddenly cooperate and work together. Now you understand what cooperation and working together means.
I will disagree here with you bro.
Pakistan needs to be cleared of militancy if we want to see the CPEC succeed and any meaningful FDI from private/multinational companies coming to Pakistan. The problem is that most of the terrorist attacks in Pakistan are planned in Afghanistan with many suicide attackers turning out to be the Afghan nationals. A friendly and cooperative Afghan government could have been engaged to quell these attacks and wiping out their perpetrators. For whatever the reasons, TTA has so far been unable to do that even though they keep claiming that their country cannot be used for launching attacks against Pakistan. We have no other option but take the initiative to pre-emptively attack the terrorists right there in Afghanistan.
The surge in such pre-emptive attacks by Pakistan that you noticed can have several reasons. To my understanding, the current military command is much more clear-headed regarding the scourge of TTP. Compare this with the cowards of likes Bajwa and Faiz Hameed who were more for appeasing those terrorists. And then our capabilities to track, chase, and hunt down the terrorists have increased many folds over the past few years.
Having said that, it is still possible that Islamabad might have come to some understanding with Washington regarding some goals to be achieved against terrorists in Afghanistan. Americans might have their own interests in Afghanistan, the most crucial one, of course, being that Afghanistan must not be used by global terrorist elements. I think, to that extent, our national interests overlap with those of China, USA, and all those countries that want to see this region having a durable stability. You can call it ghulami, slavery, or whatever. But in reality, elimination of terrorism from the region will be beneficial for not only this region, especially Pakistan, China, and even Afghanistan, but also for world at large.