Afghanistan with a proper buffer zone and even an aligned proxy in Kabul would be a non-issue — what makes the situation so dangerous is the millions of Afghan refugees living legally & illegally in Pakistan ready to become hired guns, spies, suicide bombers, and million more ethno-nationalists aligned with them. I am trying hard to not name any ethnicties but I would be lying if I didn't witness at least 20-30% Pashtuns openly defend them in some way.
Let alone the fake deportation of Afghan settlers, how do you deal with millions of nationalists who would be hired guns for Afghanistan, or become subvertive political elements attacking Pakistan and promoting division?
This is an even bigger issue than Afghanistan. They have strategic depth in Pakistan.
Pakistan being a country that's quite institutionally lazy and corrupt, especially at the police level, will struggle to effectively deal with this. Even worse, all ethno nationalists will be activated to prevent any effort at all.