The state just doesn't have the resources or political will. Our GDP to tax ratio is an abysmal 9% at best, really should be near 20%. We are short on funding and manpower for policing (most are used for security escorts of politicians, bureaucrats etc.), justice, paramilitary etc. We need serious police and judicial reforms, but nobody wants to do that because there's a shytload of money to be made in a corrupt system.
Politicians are also afraid of speaking up against terrorists - those that do are targeted - just last week they killed Bashir Bilour, a vocal anti-Taliban senior minister from the Bilour family in KP, who have been political stalwarts for decades. The current government is also focused on the next election and have made alliances with the Sunni Ittehad Council, while the main opposition party PML-N has always used religious parties for support as well.