On Tuesday morning, Pakistani Taliban attacked the Army Public School and Degree College in Peshawar, Pakistan. At least 145 people were killed, more than 100 of whom were children. Survivors described Taliban gunmen walking from one child to the next and shooting them. While the Pakistani Taliban has targeted children in the past, and has a long record of killing civilians, this attack — by many counts, the worst in Pakistan's history — was far more extreme than anything they have done before.

It is difficult not to wonder: why? Why did the group launch this unprecedented attack, and why did it choose to murder over 100 children in a single day?

There is no single explanation. But, beyond the obvious barbarity of the perpetrators, three factors seem to have driven the act. First, there is the Taliban's own explanation, that this was revenge for the military targeting their own families — though it seems unlikely that this is the real reason. Second, and much more plausibly, the group may have wanted to show that it was still viable, despite recent heavy losses against the Pakistani military. But there is also a third and potentially crucial factor: a power struggle within the Pakistani Taliban itself.

The Pakistani Taliban says this was revenge, but there's more to it

A spokesperson for the Pakistani Taliban, which goes by the name Tehrik-i-Taliban Pakistan, or TTP, claimed that the operation was carried out as revenge for army operations that had targeted the families of Taliban fighters. "Because the government is targeting our families and females," he said, "we want them to feel the pain."

It is unfortunately quite plausible that the family member of Taliban militants have been killed during the group's years-long conflict with the Pakistani military. The Pakistani military's use of bombings and artillery strikes virtually guarantee civilian casualties, and the military is not known for its pinpoint precision when operating in Taliban-dominated parts of the country. It is also plausible that the Taliban believes earnestly that the Pakistani military is deliberately targeting its family members, though whether or not that is actually the case is more difficult to say.

All the same, experts who study the Taliban believe that this is not actually the primary reason for the attack on Peshawar, and particularly not for an attack this brutal. Rather, they say, it is more likely that this was an attempt by the Taliban to reassert its power after suffering defeats at the hands of the military, or even an effort by a single faction or leader within the group to claim authority.

The Taliban, weakened, may have hoped this would be a show of force and brutality

In June, the Pakistani military launched a major and ongoing offensive against the Pakistani Taliban, deploying thousands of ground troops to the tribal region of North Waziristan in an attempt to root out militants operating from there. The Taliban's school attack may have been intended as a show of force in response to that campaign, a way to return fire and demonstrate the group's strength.

Pakistani's North Waziristan operation was a significant escalation against the Taliban. Colin Cookman, a senior program specialist at the US Institute of Peace who focuses on South and Central Asia, told me via email that the military's previous operations had been localized, limited in scope, and retaliatory rather than proactive: the army responded to specific attacks, but did not make sustained efforts to undermine the TTP as a group. This new operation is different. It has been sustained over many months and its goal is to prevent militant groups from operating in North Waziristan at all — a major step.

Perhaps the school attack, Cookman suggested, was the Pakistani Taliban's attempt to demonstrate that the military has not hindered its ability to conduct major operations. The school was run by the army, and so may have been the softest army-related target that the TTP was able to reach.

University of Chicago professor Paul Staniland agreed, saying that he believed that the school attack was the TTP's way of sending the message that the military operation had not destroyed it, and that it was still capable of inflicting damage on the military in the way that would hurt most.

The severity of the attack, in this thinking, could reflect the Taliban's feeling of insecurity — it would not need to go to such extreme lengths unless it felt it would otherwise be perceived as weak. And, indeed, it was the first significant attack by the group in months. At the same time, it could also show the group's rage at the military for its assault on the Taliban's home turf.

There may be internal Taliban power struggles behind the attack

The school's over 100 dead children may have also been the victims of something else: power struggles within the Taliban.

The TTP has split into multiple factions in recent months. A number of moderate factions have made peace with the government, Staniland explained, so that what is left behind is an increasingly radical core that is splintering into different groups. That process was accelerated when Maulana Fazlullah, an outsider who formerly headed a group of militants in Pakistan's Swat district, took command last year. He has been a divisive leader, causing the powerful Messud family to leave and form its own organization.

Competition for power within an armed group or between different splintering factions often leads to increased violence, as leaders jockey to prove their authority and improve their reputations by carrying out ever more audacious or brutal attacks.

There is some evidence to support this theory. Early indications are that Fazlullah's faction was responsible for the attack on the school. It may have been intended as a show of force to establish his faction's dominance. Likewise, the spokesman's statements may have been an attempt to claim the mantle of the TTP leadership by positioning the group as the defender of women and children from the Pakistani military.

However, Staniland expressed skepticism of the theory, noting that it would be extremely risky for a faction to use this kind of attack to establish that it was "in charge," because it is almost certain to prompt harsh retaliation from the military. And it may also cost the group whatever public support it previously had: Cookman noted that Fazlullah faced a significant public backlash when he ordered the assassination of Malala Yousafzai in 2012. Today's attack was similar, but on a far greater scale, and so may provoke an even greater revulsion — even the Afghan Taliban has denounced the attack.