Islamic terrorism is staying alive because of the resurgence in the illegal opium trade. In a relationship that has been used many times before (Colombia, Burma), the drug gangs pay the Taliban for security services. As long as illegal drug production thrives in Afghanistan, so will the Taliban, and any other group wanting to be free of government control.
Opium, produced from the sap of the poppy plant, has been used by humans for thousands of years. But the expense of producing the drug limited its use to medicinal purposes, and a narcotic for the very few wealthy enough to afford it. That changed with the industrial revolution, which created more efficient production methods and more money. China was the wealthiest pre-industrial nation in the 15th century, and local production found a growing market there as well. Soon, the government realized that drug addiction was disabling a growing number of the most productive people in the empire. By the early 18th century, China began outlawing opium as a recreational drug. A century later, Britain forced China (via the two "Opium Wars") to allow opium imports from British poppy plantations in India. Britain pleaded economic necessity, because China encouraged exports, but restricted imports, and Britain needed something to even the trade balance. When opium is available, there is always a market. Opium is highly addictive, and many Chinese were willing to spend most of their income just to stay high. Sound familiar?
A century ago, China was still a nation full of opium addicts, and about 41,000 tons of opium a year were produced (five times current production), with 95 percent going to China (and now largely produced there). The Chinese Communists outlawed opium when they came to power, a popular move (even for many of the addicts).
Throughout the industrialized nations, opium had already been outlawed. It was legal until the 19th century, but addiction became a major social problem as more people could afford to get high. The historical experience is quite clear; legalizing opium, and its derivatives (morphine, heroin, codeine, etc) does not work. The problem was made worse in the 19th century, as Western chemists developed ways to concentrate the narcotic effect of opium by refining it into powerful sedatives like heroin, morphine and codeine. These were used as painkillers, and their availability was restricted to medicinal uses. A ton of heroin is made by refining 7.5 tons of opium (using 260 tons of acetic anhydride, an industrial chemical.) Heroin is a much stronger and addictive drug, and sells for 30-40 times as much as the same weight of opium.
Three decades ago, 2,000 tons of opium were produced a year, nearly all of it for legitimate medicinal products. But illegal production continued in the Golden Triangle (the ancient poppy growing area where the borders of China, Burma and Thailand meet). When the communists shut down opium production in the late 1940s, it moved to Burma and Thailand. The Thais soon shut it down, but Burma, run by a military dictatorship, needed the money, and didn't crack down until the 1990s (partly to destroy the military power of Chinese warlords who grew strong off their heroin profits). It then picked up in Pakistan, where it was soon driven across the border to Afghanistan. The Taliban heavily taxed drug production, and even halted production in 2000 because of oversupply (and falling prices.) The Taliban told Western nations that they were suppressing the opium production in return for foreign aid, but allowed opium production to resume in 2001 when the foreign aid was not forthcoming. Opium has always been all about money.
Afghanistan, Iran and Pakistan are suffering a growing opium addiction problem. There is some heroin addiction as well, but only among the wealthy. Opium is cheap (10-20 cents a gram) enough so that even the poor can get hooked (if they can hustle and steal enough money to feed their habit.) Because of religious prohibitions, alcohol is difficult to come by in these countries. Opium is easier to conceal, and provides a better high. Even Taliban members use opium. This addiction problem is why most government officials in the region are down on opium, unless they are getting large bribes from the drug gangs. This is the case in Afghanistan, but many officials oppose the drug trade anyway. It's a disease that their own children are vulnerable to. In a way, the drug trade is inherently self-destructive. Despite all the cash it brings to those running it, the drugs eventually devastate the families of those involved in the business. It is, literally, a deal with the devil. The clergy are particularly down on the opium trade, even many pro-Taliban clerics who realize that drug money supports efforts to spread and enforce their conservative religious beliefs. During the 1990s, the Taliban taxed the drug trade, even as they condemned actually using the drugs. There was quite a bit of tension within the Taliban leadership over the organizations relationship with the drug gangs. That tension has not disappeared.