From Afghanistan: A Cultural and Political History, by Thomas Barfield (Princeton U. Press, 2010), Kindle pp. 6-7:
More than any other set of events, the Communist coup and Soviet invasion opened the question of political legitimacy in Afghanistan. The old dynastic tradition was in ruins, but there was nothing to replace it. This issue of who had the right to rule and on what basis was not resolved even after the Soviet Union withdrew in 1989 and its client regime collapsed in 1992. Lacking any overarching political unity among themselves, the various mujahideen resistance factions led the country into civil war and lay the groundwork for the rise of the Taliban. These conflicts eviscerated the formal state structure they were fighting to control and engulfed an ever-larger part of the Afghan population into political struggles from which they had been previously isolated. All the ethnic and regional groups in Afghanistan became politically and militarily empowered, reversing the process of centralization that had been imposed by Abdur Rahman.
Unfortunately the successful resistance strategy of making the country ungovernable for the Soviet occupier also ended up making Afghanistan ungovernable for the Afghans themselves. While the Afghans had recovered from many earlier periods of state collapse, the body politic was now afflicted with an autoimmune disorder in which the antibodies of resistance threatened to destroy any state structure, regardless of who controlled it or its ideology. Compounding this problem was a centuries-old structural weakness: the dependency of all Afghan governments on outside aid for financial stability. In the wake of the collapse of the Soviet Union, Afghanistan found itself without world-power patrons for the first time in 150 years and hence had no significant sources of outside revenue with which to fund a central government. In the face of indifference and a lack of aid by the major foreign powers and the international community in general, the country could no longer right itself as it had done so many times in the past.
The stalemated mujahideen civil war opened the door to interference in Afghan affairs by neighboring states, strengthened regional ethnic power brokers, and facilitated the exploitation of Afghanistan’s weakness by foreign Islamist groups. At the forefront of these Islamist groups was the Afghan Taliban, which with the support of Pakistan and foreign jihadists, took power in Kabul in 1996. Although they justified their rule in Islamic terms, the Taliban were largely Pashtuns who saw all other ethnic groups as enemies. Even after they had conquered almost all the country, they never created a real government, and Afghanistan became a classic failed state. As an ally of Osama bin Laden’s al Qaeda, the Taliban were the immediate target of U.S. retribution following the 9/11 attacks on New York and Washington, DC. The Taliban fell even more quickly than they rose: once it became clear that they would lose, every region of the country (including the Pashtun south) turned against them. Foreign troops were welcomed, against all expectations, because the Afghans saw them as a bulwark of protection against the very Afghan forces that had driven the country into ruin. More pragmatically it was equally clear that the Afghan government and economy could not be revived without massive infusions of foreign aid. If other wars had driven Afghans out of the country, the end of this one brought back about four million people, the largest repatriation of refugees ever seen (and one done largely by the Afghans themselves).