

Sorry the inclusion of Taliban was a mistake, was typing too quickly. What I meant to say was the Afghan Marxist government .
Studying the history of al-Qaeda is a key to understanding the ideology and even the mentality of the movement as a whole. It began in Afghanistan in 1979 in response to the introduction of Soviet troops into the country, which caused an influx of foreign fighters from all over the Islamic world. > (Vasiliev & Zherlitsyna, 2023)
Why did the Soviets invade Afghanistan?
In April 1978 Afghanistan’s centrist government, headed by Pres. Mohammad Daud Khan, was overthrown by left-wing military officers led by Nur Mohammad Taraki. Power was thereafter shared by two Marxist-Leninist political groups, the People’s (Khalq) Party and the Banner (Parcham) Party—which had earlier emerged from a single organization, the People’s Democratic Party of Afghanistan—and had reunited in an uneasy coalition shortly before the coup. The new government, which had little popular support, forged close ties with the Soviet Union, launched ruthless purges of all domestic opposition, and began extensive land and social reforms that were bitterly resented by the devoutly Muslim and largely anti-communist population. > (Encyclopaedia Britannica , 2025)
The aim of the Soviet operation was to prop up their new but faltering client state
There you go.
Furthermore, while not every extremist group formed because of society ailments it is** a well known factor recognised by scholars*.