The Taliban represent ancient customs in Afghanistan. This includes the intense conservatism of many of the tribes living outside the towns and cities. For centuries, the tribes have survived in their remote valleys by following their own rules, making their own "foreign policy" and fighting anyone who appeared to threaten that independence. Rarely have the back-country tribes run the country, but the recent Taliban government was one of those instances. Most of the Taliban members survived fall of the Taliban government. They are still out there. They still have their guns, their memories and their dream of Taliban dominance. Unfortunately, the Taliban were dominated by a small number of Pushtun tribes in southern Afghanistan. Thus the Taliban offended the majority of Afghans, for you had to do it their way, or face a horde of pro-Taliban gunmen showing up to punish you. At the end, most of the pro-Taliban gunmen weren't even Afghans, but religious students of Pakistan or al Qaeda members. The rural Pushtun tribes of Pakistan also adhere to Taliban ideas, and are generally left alone by the Pakistan government. The Pakistan tribes provide training areas for the Taliban. Al Qaeda pays for protection, using contributions from wealthy Moslems, or those who have migrated to the West and are donating to what they believe are charitable organizations.
Second, there is a traditional hatred of outsiders (be they from far away, or a different tribe in an adjacent valley.) The Taliban exploits this to encourage attacks on foreign aid workers, or Afghans working for outfits like the United Nations. This has shut down many air programs in southern Afghanistan. Meanwhile, the tribes involved with the drug trade have plenty of money to run their own aid programs. But major aid projects, like road, school and hospital building, are difficult to carry off because of the widespread corruption. A lot of foreign supervision is required to insure that the money does not disappear before it gets to the workers building things, or local suppliers providing building materials. Too many Afghans consider it perfectly acceptable to divert large portions of aid money for the benefit of their family or tribe. This is a hard custom to change.
Most Afghan tribes will not get involved in supporting Taliban attacks, because eventually the government or warlord troops capture one of the attackers, find out there he came from and go pay his tribal leader a visit. Group punishment is still an accepted custom in Afghanistan. If a tribe cannot control its young men, they the tribe will be attacked. This system still works. But the tribes in Pakistan cannot be attacked by the Afghan government. At least not yet.
Since American troops began operating in Afghanistan in October, 2001, 31 Americans have died in combat, and 162 have been wounded. Accidents have killed 34. There are some 12,500 coalition troops still operating in Afghanistan, including about 9,000 American soldiers.