Osama bin Laden, Al-Qaeda’s founder, considered India to be part of the world Jewish conspiracy against the Muslim World. See Wikipedia “Beliefs and ideology of Osama bin Laden : India”.
Al-Qaeda supported Pakistan’s terrorist organizations that had a presence in India, and at the same time Al-Qaeda was sending fighter to fight the Indians in Kashmir. Both India and Pakistan claim that Kashmir is their territory. If India controlled Kashmir, she could export her products to Central Asia and import the oil and gas of Central Asia to India bypassing her enemy Paksitan.
At the same time India would break the geographic corridor between Pakistan and China, and it is a known fact that China and Pakistan cooperate against India. Today Pakistan controls a part of Kashmir, and India another part of it, and Pakistan can communicate with China, while India does not communicate with Central Asia. As a result India needs either Pakistan, or Iran, to reach Central Asia.
Map of Kashmir
Therefore the alliance between Al-Qaeda and Pakistan against India in Kashmir makes perfect sense, because the Arabs (Al-Qaeda) do not want India to import oil and gas from Central Asia, and Pakistan does not want Central Asia and India to communicate bypassing Pakistan. Pakistan wants the countries of Central Asia to be dependent on Pakistan if they want to reach India and the Indian Ocean.
But while Osama bin Laden was calling India part of the world Jewish conspiracy, he admired the rebellion of the Iranian Islamists in 1979, which was an Islamic but also a socialist revolution, and he also cooperated with Iran. See Wikipedia “Beliefs and ideology of Osama bin Laden : Jews, Christians and Shia Muslims”.
The explanation is of course that Al-Qaeda was fighting the Saudi King and the United States, and the Saudi government could not obviously provide Al-Qaeda with intelligence, at least not within Saudi Arabia.
Moreover, Pakistan, which through the Taliban was providing some indirect support to Al-Qaeda, was reluctant to openly support Al-Qaeda, because Pakistan was receiving generous financial and military support from both Saudi Arabia and the United States.
Therefore Al-Qaeda needed a strong military country which at the same time was an enemy of the United States and the Saudi King, in order to obtain training and intelligence. The ideal candidate was obviously Iran, and I have referred many times to the Hezbollah-Al Qaeda axis. See “The Hezbollah-Al Qaeda Axis”.
“Beliefs and ideology of Osama bin Laden : India”
Bin Laden considered India to be a part of the ‘Crusader-Zionist-Hindu’ conspiracy against the Islamic world.
“Beliefs and ideology of Osama bin Laden : Jews, Christians and Shia Muslims”
Bin Laden was profoundly anti-Semitic, and delivered many warnings against alleged Jewish conspiracies: “These Jews are masters of usury and leaders in treachery. They will leave you nothing, either in this world or the next.” He has also made at least one clear denunciation of Americans, but bin Laden held generally a favorable view of Arab Christians.
At the same time, bin Laden’s organization worked with Shia militants: “Every Muslim, from the moment they realize the distinction in their hearts, hates American, hates Jews, and hates Israelis. This is a part of our belief and our religion.” and was apparently inspired by the successes of Shia radicalism—such as the 1979 Iranian Revolution, the implementation of Sharia by Ayatollah Khomeini, and the human wave attackscommitted by radical Shia teenagers during the 1980s Iran–Iraq War. While in Sudan, “senior managers in al Qaeda maintained contacts with” Shia Iran and Hezbollah, its closely allied Shia “worldwide terrorist organization. … Al Qaeda members received advice and training from Hezbollah.” where they are thought to have borrowed the techniques of suicide and simultaneous bombing. Because of the Shia-Wahhabienmity, this collaboration could only go so far. According to the US 9/11 Commission Report, Iran was rebuffed when it tried to strengthen relations with al Qaeda after the October 2000 attack on USS Cole, “because Bin Laden did not want to alienate his supporters in Saudi Arabia.”