Editor's note: Ethan Bueno de Mesquita is a professor at the Harris School of Public Policy Studies at the University of Chicago.
(CNN) -- The attack by al Qaeda's Somali affiliate group Al-Shabaab that killed scores at the Westgate mall in Nairobi, Kenya, was horrifying. It was followed by two smaller scale attacks by the group that killed and injured both police and civilians.
Previously, a multilateral campaign against Al-Shabaab undertaken by United Nation's sanctioned African Union forces, including many from the Kenyan military, was being touted as a great counterinsurgency success story, both for the African Union and the United States. Indeed, the Obama administration directly backed the African Union forces, participated in the counterinsurgency with targeted drone and air strikes and recently formally recognized the new Somali government.
Beginning in 2011, the counterinsurgents pushed Al-Shabaab out of Somalia's capital, Mogadishu, and made it nearly impossible for Al-Shabaab to hold territory even in its former strongholds in southern Somalia. This was a stunning turnaround for parts of Somalia.
Despite these major counterinsurgent victories, many analysts interpret the recent attacks as a sign of a resurgent Al-Shabaab. The New York Times, for instance, reports that according to senior American counterterrorism and diplomatic officials the attack shows the Somali militants are as dangerous as ever. If Al-Shabaab, with its increasing ties to global jihadi groups, is capable of such spectacular attacks, the argument goes, it is stronger than we thought. Victory was declared too soon.
Nothing could be further from the truth.
The goal of Al-Shabaab is to rule Somalia. In order to do so, it must hold territory. By holding territory rebel groups establish political control, build operational capacity and gain recruits.
Terrorism is a tactic used to spread fear. It is not a tactic suited to holding territory. So, in analyzing the attack in Kenya, one must ask why Al-Shabaab has resorted to a tactic so ill-suited to its goals.
The answer is that terrorist and other unconventional attacks are now all that Al-Shabaab can manage, precisely because of the success of the counterinsurgent campaign against it.
Terrorism is a weapon of the weak. Rebel groups turn to terrorism when they lack the human and material resources required to field a fighting force capable of using conventional tactics that might actually take and hold territory. That is, terrorist attacks are a sign that rebels are losing -- not winning.
This is a pattern that has been seen repeatedly throughout the history of counterinsurgency. Brutal but effective Russian counterinsurgency efforts in the second Chechen war degraded Chechen rebels' public support and operational capacity. In response, those rebels shifted tactics, resulting in dramatic terrorist attacks in the Moscow Metro in 2010. Those attacks, though deadly, were a sign of a Chechen rebellion no longer able to seriously challenge Russian counterinsurgents.
After the Tet offensive during the Vietnam War, when American and South Vietnamese operations rested local control over a village, mobilization for the North Vietnamese declined in those villages and, as a result, conventional attacks by the North Vietnamese decreased and unconventional attacks by the Viet Cong increased.
The rise of the Irish Republican Army as a terrorist organization can be largely attributed to similar dynamics. After its defeat in the civil war of the early 1920s, the remaining IRA rebels, unable to field a conventional fighting force capable of conventional operations against British and Free State forces, turned to terrorist tactics and assassinations.
Counterinsurgency is a strategically complex business. Rebels shift tactics and strategies in response to changes to their operational environment. Consequently, it is a mistake to expect that every counterinsurgent victory will be followed by a reduction in all forms of violence.
We must learn to recognize when an uptick in violence is really a sign of resurgence and when it is a sign of a rebel group on its heels, fighting for survival. Terrorist attacks by groups like Al-Shabaab that used to control large amounts of territory are an instance of the latter phenomenon. No rebel group loses quietly. But governments must show resolve in the face of attacks, which should be understood for what they are—a sign the counterinsurgents are winning.
Follow us on Twitter @CNNOpinion
Join us on Facebook/CNNOpinion
The opinions expressed in this commentary are solely those of Ethan Bueno de Mesquita.