Twenty years after the worst terrorist attack in history, there hasn’t been “another 9/11.” By one count, 107 people have been killed in jihadist attacks in the United States since Sept. 11, 2001, and nearly half of those were in one attack — the 2016 Orlando nightclub shooting. Any deaths are tragic, but more Americans are dying of covid-19 every two hours than died of Islamist terrorism in the United States during the past 20 years.

You would think this counterterrorism success would be celebrated. Instead, on the 20th anniversary of 9/11, the “global war on terror” — as it was once called — is widely reviled. Most of the chatter today is, as my Post colleague Ishaan Tharoor noted, about the “dark legacy of U.S. counterterrorism” and “American imperial hubris and overreach.” An Atlantic article argues: “After 9/11, the U.S. got almost everything wrong.” The Nation’s cover story proclaims: “20 years of bloodshed and delusion.”

No one can deny the appalling mistakes and horrifying abuses committed in the name of fighting terrorism. The whole invasion of Iraq was a terrible blunder — and it gave rise to a new terrorist group, al-Qaeda in Iraq, the forerunner of the Islamic State. The invasion of Afghanistan was unavoidable once the Taliban refused to hand over al-Qaeda leaders, but the war was marred by numerous wrong turns. The use of torture was an abomination that stained America’s legacy and helped our enemies.

But most of the excesses of the war on terrorism were curbed during President George W. Bush’s second term and President Barack Obama’s first. What was left was a more modest and humane counterterrorism policy — designed to reduce, not eliminate, the threat — that commanded bipartisan support.

The crux of that effort has been improving domestic security and intelligence collection and sharing. New America, a Washington-based think tank, notes that on Sept. 11, 2001, the U.S. no-fly list contained only 16 names. By 2016, the list had expanded to 81,000 people. Before 9/11, there was no Department of Homeland Security, no Transportation Security Administration, no National Counterterrorism Center. Now those agencies keep us safe.

All of the drone strikes conducted by the U.S. military and CIA in ungoverned territory — in Somalia, Yemen, Libya and Pakistan — have been more ambiguous in their impact. New America estimates that over the past 20 years, the United States has carried out 1,604 drone strikes in those countries, killing roughly 4,727 to 6,601 combatants and 405 to 594 civilians. Undoubtedly those attacks have created fresh enemies, but they also disrupted terrorist plots — which is why four presidents of both parties have continued the strikes.

It’s hard to convince people that the war on terrorism has been successful precisely because it has largely achieved its objectives. We pay attention to the disasters that occurred — especially the tragic loss of more than 7,000 U.S. troops — while taking for granted the disasters that didn’t occur.

It’s salutary, therefore, to remember how many terrorist plots were foiled over the past two decades. New America reports that 471 people have been charged with offenses related to jihadist terrorism in the United States since 9/11, while another 39 died prior to being charged but were widely reported to have engaged in such activity.

The reason there wasn’t another 9/11 wasn’t because al-Qaeda decided to stop attacking us. It was because it lost the ability to do so. In Foreign Affairs, terrorism researcher Nelly Lahoud writes that, in 2004, Osama bin Laden outlined plans for “martyrdom operations akin to the 9/11 New York attack.” His subordinates had to tell him that, as Lahoud writes, “al Qaeda had been crippled, and such operations were out of the question.”

By that point, several al-Qaeda attempts to repeat the “planes operation” had already gone awry, including a plan to fly a hijacked airplane into the tallest building in Los Angeles. Yet al-Qaeda has never given up its ambition to use aircraft as weapons of mass destruction. Less than a year ago, the Justice Department indicted a Kenyan affiliated with al-Shabab, al-Qaeda’s Somalia affiliate, of “conspiring to hijack aircraft in order to conduct a 9/11-style attack in the United States.” He was arrested in the Philippines while in pilot training.

Al-Qaeda had even more terrifying ambitions to acquire actual weapons of mass destruction — something that Osama bin Laden called a “religious duty.” The group tried to get its hands on fissile material and established close links with renegade Pakistani nuclear scientists. Its goal was to kill 4 million Americans.

There are multiple explanations for why so many Islamist plots were foiled, including overly grandiose ambitions and mistakes in execution. For example, Richard Reid tried and failed to set off shoe bombs on a flight from Paris to Miami in 2001, and Faisal Shahzad tried and failed to set off a car bomb in Times Square in 2010. But New America concluded: “The limited threat to the United States is in large part the result of the enormous investment the country has made in strengthening its defenses against terrorism in the post-9/11 era.”

If it hadn’t been for the war on terror, there likely would have been many more victims of Islamist terrorism in the United States. That is a lesson we are at risk of forgetting — to our great potential cost — if we write off the whole 20-year effort as a costly debacle. While right-wing terrorism has surged in recent years, Islamist terrorism has hardly disappeared — and could be turbocharged by the U.S. withdrawal from Afghanistan. We need to keep our guard up.