Winning in Afghanistan is difficult, for anyone, anytime. For thousands of years, the area now known as Afghanistan was actually divided into tribal areas, and each tribe considered itself a "nation" (with borders, laws and an armed force of adult males ready to fight). Parts of Afghanistan often came under the control of nearby empires. Western Afghanistan was subject to Iranian control, eastern Afghanistan to Indian rule, while the north saw Chinese and Turks holding valuable trade routes (the Silk Road) between East Asia and the Middle East. Two centuries ago, "Afghanistan" appeared as British controlled India established borders that defined the extent of eastern and southern Afghanistan. The Iranian (or "Persian") empire shrank, leaving us with the current western border of Afghanistan. In the north, the Mongol and Turkic empires disappeared, replaced by Russian conquests in Central Asia, giving us the northern border. Within Afghanistan, there were dozens of tribes, dominated by those speaking Pushtun. In the south, it was almost all Pushtun, but there were Pushtun tribes in the north as well, where they were surrounded by more numerous Tajik (Indo-European, like north India and Iran), Turkish (mainly Uzbek) and Mongol (Hazara) tribes. Hemmed in like this, these tribes, in the middle of nowhere, formed a loose alliance, nominally led by a Pushtun king. The king really just presided over the tribes, helping to settle disputes, and deal with outsiders (mainly the British controlled Indians, Russians and Iranians).
The introduction of Western technology (more productive agricultural methods, medicine and better sanitation) eventually caused a population explosion. For over a thousand years, Afghanistan had supported no more than about 2.5 million people. But in the 19th century that changed and by 1900 population had doubled to five million. Fifty years later, it had more than tripled, to 16 million. It has since doubled again. Even with more productive agricultural methods, there was eventually a land and water shortage, and more disputes between the tribes. Communism and other Western political ideas had come to Afghanistan as well, and the Russian invasion in 1979 was triggered by a tribal rebellion against urban Afghans trying to impose a central government, and more alien ideas on a still very medieval mindset in the countryside. While the Russians left (more because of impatience than military defeat) in 1989, that war between the traditional tribes and the urban reformers continues.
In the meantime, another element was introduced, warlords who were becoming fabulously rich (by Afghan standards) making (via poppy plants and refined opium) heroin and exporting it to the world. Saudi Arabia caused a real mess by introducing their ultra conservative brand of Islam (Wahhabism) in the 1980s, while supporting the Holy War against the atheist communists (Russians and their urban Afghan allies). Pakistan had also adopted Islamic conservatism in the 1970s (as an attempt to eliminate the corruption and misgovernment that was crippling the country). Pakistan allowed the Saudis to set up religious schools in the Afghan refugee camps, and from these the first Taliban were recruited and, armed by the Pakistanis, sent into Afghanistan to halt the civil war that broke out after the Russians left. This led to al Qaeda obtaining sanctuary in the 1990s (after being chased out of several other Moslem countries.) Then came September 11, 2001, and here we are.
Without al Qaeda and its terror campaign against the West, Afghanistan would still be a mess. If the Russians had not invaded to protect the local communists, Afghanistan would still be an collection of tribes presided over by a Pushtun king, and eventually corrupted by drug lords. The heroin trade was going to be driven out of Burma (the Golden Triangle) eventually, and Pakistan was the likely place for it to move to. The Pakistanis were pretty united in driving out the heroin trade, which they did, and it moved into Afghanistan, where it naturally thrived in the largely lawless tribal confederation that has existed there for centuries. Even without Islamic terrorists and Western troops in Afghanistan, there would still be an "Afghan Problem," but it would mainly be about the place being the source of the world's heroin supply. Modernization would still be taking place (the largely illiterate Afghans quickly came to love TV, cell phones and SUVs), and causing friction with traditionalists. The end of the Cold War would have brought a flood of cheap Cold War surplus weapons (mainly from the former communist states, and including millions of AK-47s selling for as little as twenty dollars each).
The "Afghan Problem" would still consist of drug lords, a largely illiterate tribal population, torn by those seeking to preserve the old ways, and a minority seeking reform, or a way to escape to the West (or anywhere else.) The "enemy" in Afghanistan is a lot more than the Taliban, and victory won't come quickly or cheaply.