In the morning of Dec. 16, seven militants in stolen paramilitary uniforms climbed over a boundary wall and gained access to the Army Public School compound in Peshawar, the capital of Khyber Pakhtunkhwa province in northwestern Pakistan. They entered the auditorium and then moved on to classrooms, methodically killing students. By noon, a siege developed as military units surrounded the school; fighting between militants and the army continued for eight hours before the army could take control. The total death toll for the massacre, according to the military’s spokesman, Gen. Asim Bajwa, was 145, including 132 students, and a further 121 students were wounded.

This attack has shaken Pakistani society to the core. It also represents one of the most horrific incidents in a brutal insurgency against the Pakistani state and civil society by the Pakistani Taliban. Soon after the attack commenced, the Pakistani Taliban, formally known as the Tehrik-e-Taliban Pakistan (TTP) took responsibility for it. The TTP has waged an insurgent conflict in Pakistan’s northwest for over a decade. At one level, this mass targeted violence against children is morally incomprehensible. To echo the sentiments of many in Pakistan and abroad, there are simply no words for this. At another level, however, the Army Public School attack is situated within a bloody history of conflict in Pakistan’s northwestern periphery, a history that needs to be engaged and its dynamics understood.

There is a tendency among U.S. policymakers and policy analysts to elide the differences between the Afghan Taliban and the TTP, and to ascribe the rise of both to state failure. In a recent article in Studies in Comparative International Development, I discuss the roots of the Taliban insurgency in Pakistan, and argue that the recent disruption of exceptional state-society relations in the Tribal Agencies, rather than state failure, was responsible for the scope and depth of insurgent violence in northwestern Pakistan. In what follows, I will step back from the recent massacre and assess the roots of the TTP, its current liabilities, the conceptual differences between Taliban groups in Afghanistan and Pakistan, and the actual policies and potential directions of the Pakistani state in addressing the insurgency.

The TTP is a loose coalition of militant groups, mainly comprised of those from Pakistan, particularly from the Federally Administered Tribal Areas (FATA) in the extreme northwest, who joined the Taliban in Afghanistan in the 1990s. Soon after the U.S. invasion of Afghanistan in late 2001, these groups crossed the border and started engaging Pakistani military units deployed in the Tribal Areas as part of Pakistan’s U.S. alliance obligations. After 2004, these engagements grew into a domestic insurgency, with heavy fighting and significant military losses in the Tribal Areas and the Swat Valley. The TTP coalition was formed in 2007, following the Red Mosque incident. The ability of TTP militias to gain traction in FATA during this period arose out of the social disruptions that accompanied the Afghan conflict, from the targeted elimination of extant tribal leadership to the limited capacity of the Pakistani military and its allies to successfully conduct counterterrorism. FATA is an area with exceptional, but disrupted, mechanisms of “hybrid” governance. The ways in which the Afghan conflict after 2001 destroyed these governance institutions, rather than any evidence of support for the TTP among the population of FATA, lie at the heart of the insurgency’s intractability.

From 2007 until 2011, the TTP unleashed a series of brutal attacks against military and civilian institutions in the northwest and throughout the country, killing thousands and challenging the state’s ability to protect its citizenry. During this period, too, U.S. drone attacks against targets in the tribal areas intensified, killing both militants and civilians and bringing into question the credibility of the Pakistani government to control coercion within its territory.

Several years later, however, the TTP is a shell of its former self, for several reasons. First, the focus of Islamist militancy in Pakistan has shifted away from an insurgency based in the Tribal Areas to more a geographically diffuse sectarian conflict, with Sunni militant groups targeting the Shiite population. Sectarian militants have been attracted to the rise of the Islamic State; some have left Pakistan to fight in Syria and Iraq. Second, the TTP coalition has become much more factionalized since its first two leaders, Baitullah and Hakimullah Mehsud, were killed in drone attacks. The current TTP leader, Maulana Fazlullah from the Swat Valley, is a relative outsider in a coalition based in North and South Waziristan. Fazlullah’s leadership has led to significant infighting. Lastly, the Pakistani military, in response to both domestic and international pressure, recently launched a large-scale multiservice offensive operation, Zarb-e-Azb, in an effort to destroy all insurgent bases in North Waziristan. Mohammad Khorasani, the TTP spokesman, issued a statement indicating that the Army Public School attack was in direct retaliation to Zarb-e-Azb.

In light of this, as the Guardian’s Jason Burke and the Economist have noted, the Peshawar massacre should be taken as a sign of the TTP’s weakness and desperation, rather than their strength and capacity. A group that has, in the past, been able to carry out devastating attacks on military and civilian security targets – including one on Army General Headquarters in 2009 and another on a naval airbase in 2011– has now attacked a quintessentially “soft” target. The TTP’s capacity for mayhem and carnage aside, the group’s choice of targets may signal their diminished coherence and power in challenging the state.

The attack, and its reaction, also highlight the wedge between the Taliban in Pakistan and in Afghanistan, and the differences between the groups’ roots and trajectory. The latter, with whom the TTP shares little in the way of durable organizational or operational linkages, has been building up a political organization and revising policies, such as on the education of girls, in anticipation of possible negotiations with the Afghan government led by the newly elected president, Ashraf Ghani. The Taliban in Afghanistan put out a statement condemning the attack on religious grounds, stating, “the intentional killing of innocent people, children and women are against the basics of Islam.”

The Afghan Taliban can plausibly claim to represent those Afghans in the south and east disaffected by the corruption and alienation of the Pashtun population that characterized the regime of former president Hamid Karzai. The TTP, meanwhile, has set its objective as the violent overthrow of the Pakistani state, and the group has increasingly alienated the long-suffering tribal populations it claims to represent; tribal groups have autonomously raised anti-Taliban militias in Bajaur Agency and elsewhere. The dissonance between the TTP and the Afghan Taliban will only increase as NATO’s International Security Assistance Force mission in Afghanistan concludes. The sponsorship by Pakistani intelligence agents of elements of the Taliban in Afghanistan, including the Haqqani network, is certainly troubling and increasingly problematic for both sides, but this should be considered separately from the TTP challenge to the Pakistani state. Pakistan’s recent operations have targeted the Haqqani infrastructure, perhaps signaling a shift in Pakistan’s overall strategy.

The Dec. 16 massacre has had significant impact on the internal dynamics of the Pakistani state and its potential to address the insurgency. Specifically, Pakistan’s military leaders and Prime Minister Nawaz Sharif’s civilian government were until recently in conflict over the former president Pervez Musharraf’s treason trial and the Army’s covert sponsorship of Imran Khan’s antigovernment agitations in Islamabad. Military leaders and the Sharif government now find themselves together answerable to the demands of a hurt and angry population in search of security and a suitable response. Khan, who campaigned on rapprochement with the TTP, has condemned the attack, called off an agitation scheduled for Dec. 18, and participated in an all-party conference.

Significant infrastructural challenges confront the Pakistani state in the wake of this massacre. First and foremost, as the focus and tactics of the insurgency shifts, the capacities of Pakistan’s civilian and paramilitary security apparatus, weak and marginalized in relation to the military, need to be expanded. State agencies must implement strategies that can protect the civilian population, regardless of sect or ethnicity. These strategies could range from equipping and training provincial police to increasing domestic intelligence and investigation capacities to enhancing interagency and intergovernmental cooperation on terrorist interdiction. Second and relatedly, the Pakistani state must help to rebuild mechanisms of trust, authority and governance within the Tribal Areas that have been fatally damaged by the insurgency, if the TTP are truly to be denied a safe haven.

Pakistani citizens have suffered much over the last decade. The killing of 132 schoolchildren is the latest and most horrific in a series of attacks designed to break the resolve of the country. At least for now, Pakistan stands more united in the face of this tragedy than it has been for years. The question is whether such unity can be transformed into meaningful change in the political dynamics of Pakistan and the rebuilding of an effective people-centered political order, in FATA and across the country, after a decade of insurgent conflict.

Adnan Naseemullah is a lecturer in South Asia and international relations in the department of war studies and the India Institute, King’s College London.