For the past few years, the State Department's annual report on global terrorism has been dismal reading. Between 2012 and 2014, deaths from terrorism around the world spiked by 200 percent.

But this year's report, released late last week, found that this trend has reversed. Terrorism deaths actually declined in 2015, by about 13.4 percent:

As with all single-year statistics, this could just be a blip. It's possible the trend line will go back up when we get next year's report on 2016, and what looks like progress this year will end up being ephemeral.

But a close look at the data suggests that this is the result of real developments: major battlefield defeats of the world's deadliest terrorist groups. That should give us some hope that this happy trend will continue — that is, that terrorist violence might be becoming less of a threat to global stability.

And if you take a step further back and look at the terrorism data in a broader context, it points out something important: Even when it's spiking, terrorism just isn't nearly as big of a global threat as most people tend to think it is.

The big drops are in Iraq and Nigeria, where terrorist groups have lost ground

The 2014 spike in terrorist violence came principally from two places: Iraq and Nigeria, owing principally to the activities of ISIS and Boko Haram (respectively). That year, both groups stepped up the pace of attacks considerably, using terrorism as part of successful campaigns to seize large amounts of territory. At their peaks, ISIS held a swath of territory in Iraq and Syria the size of the UK, and Boko Haram controlled a Belgium-size chunk of Nigeria.

Yet by the end of 2015, deaths from terrorism in Iraq and Nigeria dropped considerably, making up the bulk of the worldwide decline in terrorism recorded in the State Department data. The reasons why are fairly clear: Both groups were put on the military defensive and ended up suffering significant military defeats.

In Iraq, terrorist attacks were a key part of ISIS's offensive strategy, which is why they were so frequent. Yet by late 2014, the group was forced to concentrate on defending territory in conventional battles — which obviously meant less offensive terrorism. The momentum turned against ISIS for a number of reasons: US airstrikes disrupted its ability to conduct massed offensives, Iraqi forces adapted to the group's tactics, and stepped-up resistance from Syrian Kurds pressed the group in Syria.

Between January 2015 and mid-March 2016, ISIS lost about a quarter of its territory in Iraq and Syria. The US government estimates that ISIS recruitment of fighters from abroad has dropped by at least 75 percent. This weakened ISIS considerably, limiting its ability to launch the large-scale offensives it had waged previously. Of course, it still can launch terrorist attacks here and there — and will likely launch more of them in the coming year to try to show it's still relevant. But a 2014-style offensive wave of attacks is clearly out of the question.

The story is somewhat similar in Nigeria. In 2014, Boko Haram made massive military gains in Nigeria, seizing control of huge swaths of the country. You might remember them kidnapping 276 girls from school in the village of Chibok in April of that year.

But in the summer of 2015, newly elected Nigerian President Muhammadu Buhari launched a new offensive against Boko Haram's strongholds in northeastern Nigeria. The offensive was coordinated with nearby Chad, Cameroon, and Niger, who attacked Boko Haram bases outside of Nigeria and cut off some of its key supply lines. The US and European powers provided intelligence and other support.

By November, the group had lost significant territory. The offensive also devastated Boko Haram's ability to exercise state-like control over the territory it still held, and rendered it at least temporarily incapable of launching 2014 levels of terrorist violence. Nigeria analysts Hilary Matfess, Peter M. Lewis, and Nathaniel D. F. Allen explain in Foreign Affairs:

The extremist group was responsible for just a little over 1,100 deaths in the five months between August and December 2015, the lowest toll of any five-month period since 2013. Boko Haram’s contracting territory and reduced military capabilities are signs of a shift of momentum against the network.

This offensive didn't "defeat" Boko Haram as a group, as Buhari falsely claimed in December. "Using women and even children as bombers, Boko Haram has mounted dozens of coordinated attacks, striking as far afield as Chad’s capital of N’Djamena last June and July," Matfess and company write.

But it did do significant damage to the group, weakening its capacity to commit the kind of large-scale violence it had previously. "Boko Haram is no longer occupying large parts of Nigeria," Max Siollun wrote in the New York Times in March. "Instead, it has morphed into a group of well-organized bandits. The military’s successes changed Boko Haram’s threat, but didn’t eliminate it."

Terrorists with territory are scarier, but also easier to fight

Terrorist groups are, almost by definition, less capable of committing mass violence than governments are. Governments control territory, which means they are capable of extracting money from citizens and using that revenue to build up a powerful fighting force. Most terrorist groups operate in the shadows, through shady funding mechanisms that almost never equal the budget of even a small sovereign state.

What made ISIS and Boko Haram so scary in 2014 is that they controlled huge amounts of territory, allowing them to act something like a state. Indeed, the core of ISIS's ideology is that it would create a caliphate — a goal Boko Haram endorsed after it formally pledged loyalty to ISIS in March 2015.

The idea of a terrorist group using waves of terrorist violence to seize control of state-like resources was what was truly scary about the groups' advances in 2014. If that model proved successful, they could have expanded their terrorist campaigns considerably, both regionally and globally.

But there are downsides to holding territory — most notably that it makes you easier to find. To hold territory, you need to have fighters defending it, rather than hiding in the shadows.

"If you're a terrorist group, you're awfully hard to find," Douglas Ollivant, the former National Security Council director for Iraq from 2008 to 2009, tells me. "Once you start holding ground, we can start dropping bombs on you." And that means hitting large numbers of fighters, says Ollivant, instead of just individual Predator strikes on leaders.

That's exactly what happened in Nigeria and Iraq. Both ISIS and Boko Haram attempted to hold territory, and temporarily managed to grow stronger than most other terrorist groups in modern history. But the international community recognized both as major threats as a result, and thus devoted significant resources to defeating them.

The terrorist groups were not strong enough to beat governments at their own game — seizing and defending territory in conventional warfare — and suffered significant military defeats when they tried.

That's not to say that ISIS and Boko Haram, and other similar terrorist groups, aren't threats, or that they aren't scary. They are, especially for the people who live near them. Rather, the point is that they're inherently limited in the amount of violence they can inflict, provided states are willing to take military action against terrorist groups who aspire to state building. And the US and its allies are pretty willing.

Let's keep the threat from terrorism in perspective

A good exercise for getting some perspective on this is comparing global deaths from terrorism to two other things — the number of Americans killed by terrorism, and the number of deaths linked to car crashes in the United States:

Two things pop out here.

First, the number of Americans killed is negligible — in the teens and 20s at most. That's because the US government is a very strong state with a massive intelligence and law enforcement apparatus dedicated to disrupting terrorist plots. Though terrorism occupies an enormous space in American political discourse, the truth is that it threatens relatively few American lives.

Second, the number of terrorism deaths worldwide is lower than the number of car-related deaths in the US alone — consistently so. Terrorism is just a lot less deadly than mundane things that we usually don't worry about all that much. And if you compare terrorism to things that truly are global scourges, like civil war, HIV/AIDS, or malaria, the death toll from terrorism starts to look really tiny.

Yet American politicians are freaking out about the threat from "radical Islam," not car manufacturers or malarial mosquitos.

This speaks to the way terrorist violence works. Terrorism is called "terrorism" because it's designed to terrify, to disrupt people's sense of safety and thus create a state of panic in the targeted population. The terrorist group then exploits this fear to extract some kind of concessions directly ("Get out of our country and we'll stop") or by provoking an overreaction that ultimately ends up weakening the reacting country (such as invading Iraq after 9/11).

This entire strategy depends on terrorism's psychological effects, not its physical ones. Blowing terrorism out of proportion, and treating it as a world-historical threat to the United States rather than a relatively minor security challenge, is quite literally what the terrorists want.

That's why the State Department report, and other such data collection efforts, are critically important. They give us what should be one of our most important weapons in the war on terrorism: a sense of perspective.