The UN estimates that Afghanistan supplies 70% of the world's Opium (and therefore, much of the world's Heroin), although the reliability of this estimate is open to debate.
Although the Taliban frown upon the use of drugs, they seem to do so selectively. The Taliban implemented a ban in 1999 in accordance with the UN Convention on Drug Control and Crime Prevention, in order to improve the country's diplomatic ties to the rest of the world. However, this did not mean that Opium production was outruled completely. The regime continued to produce the product and although they did not sell it on the market, they stockpiled it (very much like the US strategic petroleum reserves).
Following the attacks, the Taliban were rather less cooperative with the UN and dramatically increased supply. The price of raw Opium on on the streets of Kandahar was around US$700 a kilo on 10 September. A week after the attacks, the price fell to US$100 because of the dramatic increase in supply.
Opium is an important source of Afghanistan's national income, much of which is used to fund the purchase of arms. Only 2.5m hectares of Afghanistan's 65m hectares of land is arable, and Opium is a product that generates an extremely high return for such a small initial investment.
Part of the reason for the shortage of food in Afghanistan is because the Taliban is choosing to grow Opium poppies rather than wheat. In a country where arable land is so scarce, this has drastic implications.