A fine-grained analysis of the mostly Punjabi terror groups in Pakistan:

The Jihadi Terrain in Pakistan: An Introduction to Sunni Jihadi Groups in Pakistan and Kashmir - Pakistan Security Research Unit

After the U.S.-led coalition ousted the Pakistan-allied Taliban the spotlight was once again on mujahideen in Pakistan. By this time, however, anti-American, anti-Jewish, and anti-Hindu ideologies were already common narratives among these groups, despite operations remaining regionally focused. It does appear that the message of jihad is becoming increasingly transnational for some of these groups, but reports that conflate them with the broader global Salafi jihad seem oversimplified.

This is certainly not to downplay the danger that these groups pose to human security and overall stability in the region. Their goals, organizational structures, and demographics differ in several ways from the global Salafi jihad, but they are no less lethal in their mission. The ability of these groups to incite Islamic fervor against India and the West and in the name of Kashmir has left a bloody trail, and their ability to cleave sectarian rifts in Pakistan has taken a massive toll on the country’s society and national identity. Their availability as a cheap and able proxy against India has helped keep the Pakistani military a state within a state. Aside from their role in broader Islamist militancy, these groups are entrenched as obstacles to security and state-building in Pakistan ...


I think it's quite clear with the Punjabi origin of many of the attackers in Lahore, Islamabad, and Rawalpindi that some of these groups have allied with the TTP. Increasingly these groups are acting in direct opposition to their former state sponsors in the Pakistani security services.