The current spasm of international terrorism, an age-old tactic of warfare, is often traced to a bomb mailed from New York by the anti-Castro group El Poder Cubano, or Cuban Power, that exploded in a Havana post office, on January 9, 1968. Five people were seriously injured. Since then, almost four hundred thousand people have died in terrorist attacks worldwide, on airplanes and trains, in shopping malls, schools, embassies, cinemas, apartment blocks, government offices, and businesses, according to the National Consortium for the Study of Terrorism and Responses to Terrorism. The deadliest remains the 9/11 attack, sixteen years ago this week, which killed almost three thousand people—and in turn triggered a war that has become America’s longest.

I’ve covered dozens of these terrorist attacks on four continents over that half century. After the Barcelona attack and the U.S. decision to send more troops to fight the Taliban, I began to wonder how terrorism ends—or how militant groups evolve. In her landmark study of more than four hundred and fifty terrorist groups, Audrey Kurth Cronin found that the average life span of an extremist movement is about eight years. Cuban Power carried out several other bombings, but, in the end, it didn’t last a whole year.

I’ve also witnessed some transitions that I never thought would happen. I interviewed Yasir Arafat several times when the United States considered him a notorious terrorist. He was a paunchy man of diminutive height, a bit over five feet, with a vain streak. He always wore plain fatigues, crisply pressed, and a checkered kaffiyeh headdress to conceal his bald pate. He was linked, directly or indirectly, with airplane hijackings, bombings, hostage-takings, and more. Israel thought that Arafat was defeated after its 1982 invasion of Lebanon. I watched from the Beirut port as the chief of the Palestine Liberation Organization and his fighters sailed off to new headquarters in Tunisia, a continent twenty-five hundred miles, by land, from the frontlines.

Eleven years later, I was in Washington when Arafat and Yitzak Rabin signed the 1993 Oslo peace accords. They shared the 1994 Nobel Peace Prize. President Bill Clinton hosted Arafat more than any other head of state. I flew with the next four secretaries of State to see Arafat, to discuss the next steps for an enduring peace, in the Palestinian Authority. A quarter century later, it’s far from over. But it did begin.

In the run-up to the 9/11 anniversary, I reached out to eight terrorism experts who’ve long studied the phenomenon at the C.I.A., the F.B.I., the National Security Council, the State Department, the Rand Corporation, and in academia. They identified six ways terrorism evolves, fades, or dies—and under what conditions it succeeds.

Fewer than five per cent of terrorist groups succeed outright, Cronin told me. Among the most notable was Irgun. The Jewish group bombed Britain’s colonial offices in Palestine and diplomatic sites abroad, as well as local Arab targets. Its most famous attack was in 1946, when members, dressed as waiters, planted a bomb, concealed in milk cans, in Britain’s headquarters in Jerusalem’s King David Hotel; ninety-one were killed. The group was then led by Menachem Begin. Two years later, Irgun realized its goals when British troops withdrew and the state of Israel was founded. Three decades later, Begin, then the Prime Minister, shared the Nobel Peace Prize for détente with Egypt.

Another was in South Africa. In 1961, Nelson Mandela founded the armed wing of the African National Congress. Its first attack was five bombings on government facilities on the same day, in Johannesburg, Durban, and Port Elizabeth. Mandela was arrested and sentenced to life for sabotage. Decades later, as apartheid floundered, the white-minority government ceded power.

Extremist groups are more likely to succeed when objectives are limited or attainable, “such as independence, a role in government, or a piece of territory,” Richard Clarke, the national coördinator on counterterrorism under the Clinton and George W. Bush Administrations, told me. “If a group can increase the pain point to the decision-makers, they will give in. That was true of many independence movements, including the American Revolution.”

“Then they go straight,” Clarke added. “They trade off their radicalism to become a government that is not that out of line with other governments of the world.”

More common—about eighteen per cent—are terrorist movements that end up negotiating to achieve their political goals. “They are the groups that hang on the longest. Their life span as terrorists is usually twenty to twenty-five years,” Cronin told me. “Usually, the talks trundle along. They often take years, and some lower level of violence continues,” she said. “But they rarely fail outright.”

The P.L.O. negotiated. This summer, Colombia’s FARC guerrillas ended a half century of kidnappings and killings in a historic peace deal. Northern Ireland’s Provisional Irish Republican Army was party to the 1998 Good Friday Agreement. It had attacked London’s financial district, in 1993; the British Prime Minister’s residence, at 10 Downing Street, in 1991; and the hotel where Margaret Thatcher’s Conservative Party was meeting, in 1984. Today, Sinn Féin—the I.R.A.’s political wing—is the most popular party in Northern Ireland, Bruce Hoffman, the author of “Inside Terrorism,“ noted. “The leaders of the moderate Catholic party—the Social Democratic and Labor Party—won a Nobel Peace Prize, but it’s Sinn Féin that is being elected now.”

Negotiations respond to other factors. The P.L.O., FARC, and the I.R.A. were weakened by military campaigns against them and ebbing momentum. Israel, Colombia, and Britain, in turn, altered course as costs mounted over decades and public support waned.

But when extremist groups walk away from negotiations—as happens ten per cent of the time—they often get crushed. Sri Lanka’s Tamil Tigers pioneered the suicide vest. It was the only terrorist group to assassinate two world leaders—India’s Rajiv Gandhi, in 1991, and the Sri Lankan President Ranasinghe Premadasa, in 1993. At its peak, it controlled strategic chunks of the country. But years of sporadic peace talks broke down in 2006. In 2009, the Sri Lankan military crushed the Tigers in a relentless offensive.

A third pattern is terrorist “reorientation,” when groups alter tactics, sometimes even entering politics. I lived in Beirut when embryonic precursors of Hezbollah launched the first suicide bombing against an American Embassy, in 1983. After the attack, the seven-story building, which was down the hill from my office, looked like a doll’s house with its façade blown off. Sixty-four died, including some of my friends. Six months later, a bomber drove a Mercedes-Benz truck into the barracks of U.S. Marine peacekeepers in Lebanon. Two hundred and forty-one marines died in the largest loss of U.S. military life in a single incident since the Second World War. I still recall the roar of that bomb waking me up on a balmy October morning, and watching for weeks as the bodies of my countrymen were recovered from under tons of debris.

A decade later, Hezbollah emerged from the underground to run for Parliament, build a network of social services, and greatly expand its support base. Today it has seats in Parliament, Cabinet positions, an alliance with Lebanon’s President, and the largest military force outside the army, as well as hospitals, schools, and welfare agencies. I spent several hours interviewing its leader, Hassan Nasrallah, in 2006, and his deputy, last October. Yet Hezbollah still calls for Israel’s destruction. The United States considers it one of the most dangerous terrorist groups.

“Hezbollah doesn’t rule Lebanon, but it controls it. The message is that terrorism pays. It is translated into power,” Hoffman told me.

Cronin added, “This is the least satisfactory pattern.”

The fourth path is state repression, the most instinctive reaction. It worked against the Tupamaros, in Uruguay, in the nineteen-seventies. But the results often produce massive destruction, unintended consequences and mutations. Russia’s campaign against Chechen extremists made vast swaths of Grozny uninhabitable, and Chechen militants moved elsewhere. Since 2014, thousands of Chechens have joined ISIS in Syria and Iraq.