South Asian history of the past 40 years has been shaped by two key events: The Iranian Revolution and the Invasion of Afghanistan.
In the former, Iran went from being an American puppet state (the largest benefactor of American military aid, in fact) to a successful Islamic regional power with a knack for proxy warfare. In the latter, the regions hard-scrabble fundamentalists wore down and defeated the full might of the Soviet Union. In both cases, American missteps figured prominently: in 1977, Stansfield Turner fired nearly everyone involved in human intelligence gathering. In 1979, the United States was taken completely unawares by the Iranian Revolution. In 1983, Iranian proxies killed 300 marines in their barracks in Beirut. In 1985, the CIA station chief for South Asia was kidnapped and murdered. We were losing the middle east and we were losing it badly.
Our response was to throw money at anything and everything that opposed Iran (who were Shia and hated throughout the Sunni world) or the Soviet Union (who were godless heathens). The direct result was that everyone who wasn't on Iran's payroll was on the US payroll. It was a small world because there were only two real sources of financing - those scrappy freedom fighters managed to push out the Soviets because we gave them $600m a year in frontline military hardware.
9/11 has always smelled like a conspiracy to everyone. It took me a lot of reading to really come to terms with the fact that there's so much whiff of coverup because nobody ever mentions bin Laden being on the CIA payroll. But if he wasn't on the CIA payroll it was the biggest oversight in the history of the agency; he was a textbook perfect guy for our ham-handed "throw money at it" approach to foreign manipulation.
Ayman al-Zawahiri came to the US in 1993 to raise money for Afghan children. He addressed a bunch of mosques in California. The official party line is that the US didn't know. It's far more likely that the US didn't care... because in 1993, we were all about the Afghan children.
In islamic terrorist politics, all roads lead to Uncle Sam.