The war in Afghanistan is more about changing thousands of years of bad habits, than it is defeating the Taliban and al Qaeda. Economically, Afghanistan is a black hole in the middle of Eurasia. It is the poorest country in two continents, and the only one without railroads. All this is mainly due to unruly, and fractious Pushtun tribes living on both sides of the Afghan-Pakistan border. There are about 40 million Pushtuns involved, belonging to about a hundred different tribes and major clans. Ethnically, the Pushtuns are related to the Iranians, and many speak a closely related language (Dari), usually as a second language. Like the Kurds (another group related to the Iranians), the Pushtun tribes never united long enough to establish a nation. Currently, 70 percent of Pushtuns live in Pakistan, where they comprise 15 percent of the population, while most of the remainder live in Afghanistan, where they make up 40 percent of the population. Thus the Pushtuns are a dominant force in Afghanistan, but a major nuisance in Pakistan.
The independent spirit of the Pushtuns has always made it difficult for non-Pushtuns to govern them. The Pushtuns have been conquered in the past, but only when there was something there to make it worthwhile. The areas where the Pushtuns live are not the source of obvious wealth. The Pushtuns lands tend to be too high or dry for that. Since the Silk Road (trade route with China) dried up (because Europeans built ships making it more economical to go by sea) four hundred years ago, theres not been much there there. Britain could not justify the expense of pacifying the Pushtun tribes for the two centuries they dominated the region. Others have, when they had to. The Mongols were particularly brutal (they were always in a hurry), while the Persians were rather more clever about it. The Persians (Iranians) retain the right (as far as they are concerned) to retake control of western Afghanistan if the economic situation should change.
The core of the "Pushtun Problem" is in Pakistan, where most of them live. The Pakistanis have known, since the country was created in 1947, that they had to eventually take control of the Pushtun tribal territory, and gradually, since the 1950s, they have been doing that. Recently, the tribes have begun to notice. They are not happy with this creeping control. The Pushtuns have made their situation worse by allowing al Qaeda to hide out among them, forcing the Pakistani government so speed up their control program.
You cannot expect the unruliness of the Pushtun tribes to disappear quickly. The violence has been there for thousands of years, and the creeping pacification has been making slow progress over the last half century. Its a process of bringing government control to the major towns, and introducing new industries and businesses. More education causes more Pushtun to migrate out, and non-Pushtuns to migrate in. The Pakistani army has recruited heavily among the Pushtun, and educated and changed those recruits, by exposing them to life away from the tribe. Eventually, as this process continues, the Pushtun will change. But it wont happen quickly, or peacefully.
The recent announcement that a new, high tech, survey of Afghanistan revealed over a trillion dollars of extractable minerals, was not a big surprise to mining companies. Less sophisticated surveys over the last half century, and increased knowledge of how geography works (when it comes to predicting mineral deposits), indicated that there was great wealth there. But, in order to build needed (to move the minerals out) railroads, or simply hard surface truck routes, you first had to pacify the place. Not all the Pushtuns consider every outsider an enemy (or robbery victim), but enough of them do to make all of Pushtunstan (on both sides of the border) a no-man's-land for large commercial enterprises. No one is going to invest a billion bucks on a major mining operation, when the surrounding areas are a perpetual combat zone, and the local government largely consists of people trying to shake you down.
This is why Afghan experts laugh at those who demand a "timetable" for the pacification of Afghanistan. But sometimes you can't laugh in their face, because many outsiders simply don't want to believe how difficult the problem is. But for the more insightful and patient, the solution is pretty obvious. Build roads and schools, keep them all open, and do as much as you can to reduce lawlessness and encourage economic activity. Most Afghans just want a better life. But Afghanistan has a larger proportion of the population that favors force, extortion and theft, and that cannot be changed quickly.