Many would argue that the story of how 9/11 came about goes back, at least, to 1979 when the Soviet Union invaded Afghanistan, with which it shares a border.
Afghanistan had experienced several coups since 1973, when the Afghan monarchy was overthrown by Daud Khan, who was sympathetic to Soviet overtures.
Subsequent coups reflected struggles within Afghanistan among factions with different ideas about how Afghanistan should be governed and whether it should be communist, and with degrees warmth toward the Soviet Union. The Soviets intervened following the overthrow of a pro-communist leader. In late December 1979, after several months of evident military preparation, they invaded Afganistan.
At that time, the Soviet Union and the United States were engaged in the Cold War, a global competition for the fealty of other nations. The United States was, thus, deeply interested in whether the Soviet Union would succeed in establishing a communist government loyal to Moscow in Afghanistan. In order to forestall that possibility, the United States began funding insurgent forces to oppose the Soviets.