It's time to learn history because it's coming back to bite you in the ass.https://en.wikipedia.org/wiki/Soviet–Afghan_War
The Soviet–Afghan War was a conflict wherein insurgent groups (known collectively as the mujahideen) as well as smaller Maoist groups, fought a nine-year guerrilla war against the Soviet Army and the Democratic Republic of Afghanistan government throughout the 1980s, mostly in the Afghan countryside. The mujahideen were variously backed primarily by the United States, Pakistan, Iran, Saudi Arabia, China, and the United Kingdom; the conflict was a Cold War-era proxy war. Between 562,000 and 2,000,000 civilians were killed and millions of Afghans fled the country as refugees, mostly to Pakistan and Iran.
The foundations of the conflict were laid by the Saur Revolution, a 1978 coup wherein Afghanistan's communist party took power, initiating a series of radical modernization and land reforms throughout the country. These reforms were deeply unpopular among the more traditional rural population and established power structures. The repressive nature of the "Democratic Republic", which vigorously suppressed opposition and executed thousands of political prisoners, led to the rise of anti-government armed groups; by April 1979, large parts of the country were in open rebellion. The communist party itself experienced deep internal rivalries between the Khalqists and Parchamites; in September 1979, President Nur Mohammad Taraki was assassinated under orders of the second-in-command, Hafizullah Amin, which soured relations with the Soviet Union. Eventually the Soviet government, under leader Leonid Brezhnev, decided to deploy the 40th Army on December 24, 1979. Arriving in the capital Kabul, they staged a coup (Operation Storm-333), killing president Amin and installing Soviet loyalist Babrak Karmal from the rival faction Parcham. The deployment had been variously called an "invasion" (by Western media and the rebels) or a legitimate supporting intervention (by the Soviet Union and the Afghan government) on the basis of the Brezhnev Doctrine.
In the mid-1970s, Pakistani intelligence officials began privately lobbying the U.S. and its allies to send materiel assistance to the Islamist insurgents. Pakistani President Muhammad Zia-ul-Haq's ties with the U.S. had been strained during Jimmy Carter's presidency due to Pakistan's nuclear program and the execution of Zulfikar Ali Bhutto in April 1979, but Carter told National Security Adviser Zbigniew Brzezinski and Secretary of State Cyrus Vance as early as January 1979 that it was vital to "repair our relationships with Pakistan" in light of the unrest in Iran. According to former Central Intelligence Agency (CIA) official Robert Gates, "the Carter administration turned to CIA … to counter Soviet and Cuban aggression in the Third World, particularly beginning in mid-1979."
At a March 30 meeting, U.S. Department of Defense representative Walter B. Slocombe "asked if there was value in keeping the Afghan insurgency going, 'sucking the Soviets into a Vietnamese quagmire?'" When asked to clarify this remark, Slocombe explained: "Well, the whole idea was that if the Soviets decided to strike at this tar baby [Afghanistan] we had every interest in making sure that they got stuck. Yet an April 5 memo from National Intelligence Officer Arnold Horelick warned: "Covert action would raise the costs to the Soviets and inflame Moslem opinion against them in many countries. The risk was that a substantial U.S. covert aid program could raise the stakes and induce the Soviets to intervene more directly and vigorously than otherwise intended."
In May 1979, U.S. officials secretly began meeting with rebel leaders through Pakistani government contacts. After additional meetings Carter signed a "presidential 'finding'" that "authorized the CIA to spend just over $500,000" on "non-lethal" aid to the mujahideen, which "seemed at the time a small beginning.
Long story short, the US backed the islamists and succeeded at making Afghanistan the Soviet Union's Vietnam. Now what are the consequences of that?
Following the Soviet withdrawal, some of the foreign volunteers (including Osama bin Laden's al-Qaeda) and young Afghan refugees, went on to continue violent jihad in Afghanistan, Pakistan and abroad. Some of the thousands of Afghan Arabs who left Afghanistan went on to become "capable leaders, religious ideologues and military commanders," who played "vital roles" as insurgents or terrorists in places such as Algeria, Egypt, Bosnia and Chechnya. Tens of thousands of Afghan refugee children in Pakistan were educated in madrassas "in a spirit of conservatism and religious rigor", and went on to fill the ranks and leadership of the Taliban in Afghanistan and Sipah-e-Sahaba in Pakistan. The groups embodied new varieties of Political Islam – "Salafi jihadism" among the foreign volunteers, and a "hybrid" Deobandi jihadism among the madrassa-educated.
President Najibullah, before his ouster by the mujahideen in 1992, told a visiting US academic that "Afghanistan in extremist hands would be a center of instability." It has been claimed that the chaos may have been avoided if the Bush administration was willing to support the Najibullah and Soviet proposals of a coalition government with the guerillas, instead of a total military solution. Najibullah also told the International Herald Tribune:
If fundamentalism comes to Afghanistan, war will continue for many years. Afghanistan will be turned into a center of terrorism.
As many as 35,000 non-Afghan Muslim fighters went to Afghanistan between 1982 and 1992. Thousands more came and did not fight but attended schools with "former and future fighters". These "Afghan-Arabs" had a marginal impact on the jihad against the Soviets, but a much greater effect after the Soviets left and in other countries. (After the Soviets left, training continued and "tens of thousands" from "some 40 nations" came to prepare for armed insurrections "to bring the struggle back home".)
The man instrumental not only in generating international support but also in inspiring these volunteers to travel to Afghanistan for the jihad was a Palestinian Muslim Brotherhood cleric, Abdullah Azzam. Touring the Muslim world and the United States, he inspired young Muslims with stories of miraculous deeds, such as mujahideen who defeated vast columns of Soviet troops virtually single-handedly, angels riding into battle on horseback, and falling bombs intercepted by birds.
When back in the volunteer camps and training centers that he helped set up around Peshawar, Pakistan, Azzam exercised a "strong influence." He preached the importance of jihad: "those who believe that Islam can flourish [and] be victorious without Jihad, fighting, and blood are deluded and have no understanding of the nature of this religion"; of not compromising: "Jihad and the rifle alone: no negotiations, no conferences and no dialogues"; and that Afghanistan was only the beginning: jihad would "remain an individual obligation" for Muslims until all other formerly-Muslim lands—"Palestine, Bukhara, Lebanon, Chad, Eritrea, Somalia, the Philippines, Burma, South Yemen, Tashkent, Andalusia"—were reconquered.
The volunteers also influenced each other. Many "unexpected" religious-political ideas resulted from the "cross-pollination" during the "great gathering" of Islamists from dozens of countries in the camps and training centers. One in particular was a "variant of Islamist ideology based on armed struggle and extreme religious vigour", known as Salafi jihadism.
When the Soviet Union fell shortly after their withdrawal from Afghanistan, the volunteers were "exultant", believing that—in the words of Osama bin Laden—the credit for "the dissolution of the Soviet Union … goes to God and the mujahideen in Afghanistan … the US had no mentionable role," (Soviet economic troubles and United States aid to mujahideen notwithstanding). They eagerly sought to duplicate their jihad in other countries.
Among the approximately three million Afghan refugees in Pakistan, thousands of children were educated in madrasa boarding schools financed by aid from the US and Gulf monarchies. Since that aid was distributed according to the conservative Islamist ideological criteria of Pakistan's President Muhammad Zia-ul-Haq and Saudi Arabia (and ignoring native Afghan traditions), the schools were part of networks of the favored Hizb-e-Islami party and the Pakistan Deobandi.
Cut off from families and local traditions, the madrassa students were "educated to put Deobandi doctrines into action through obedience to the fatwas produced in the madrasses in a spirit of conservatism and religious rigor." As the Afghan students came of age, they formed "the mainstay" of the Taliban in Afghanistan and of the anti-Shia Sipah-e-Sahaba Sunni terror group in Pakistan. But unlike the traditionally non-violent Deobandi, this "hybrid movement" embraced the violence of jihad, and unlike the Islamists of Hizb-e-Islami they were uninterested in "islamizing modernity" of western knowledge or in western knowledge at all. The culture of religious purification, absolute obedience to leaders, and disinterest in anything else, is thought to explain the willingness of Hizb-e-Islami-trained soldiers to bombard Kabul with artillery and kill thousands of civilians, reassured by their commander that the civilians they killed would "be rewarded" in heaven if they were "good Muslims".