Because of being responsible for the expulsion of Babur and the other Timurid princes from Samarkand and the adjoining area (including Khorasan), the Uzbeks were the natural enemies of the Mughals.
The Khorasanian plateau linked Iran with Central Asia, and was an important trade route to China and India. The Uzbeks clashed with the rising power of the Safavids who claimed Khorasan.
The Uzbeks tried to exploit the sectarian differences with the Safavid rulers of Iran who had ruthlessly persecuted the Sunnis.
By considering an ambitious attitude of the Uzbeks, it was natural for the Safavids and the Mughals to ally (against the Uzbek).
The Ottoman (Turkish Sultan) threat from the west, compelled the Persians to be friend with the Mughals, particularly when they had to face an aggressive Uzbek power in the east.
In 1511, when Safavids defeated Shaibani Khan (the Uzbek chief), Babur had regained Samarkand; however, it was only for the short period. Further, Babur had to leave the city, as the Uzbeks had defeated the Persians.
Later, Shah Tahmasp, the Safavids monarch also helped Humayun, when he (Humayun) had defeated and ousted from India by Sher Shah.
The territorial power of the Uzbeks grew rapidly in the seventies under Abdullah Khan Uzbek.
In 1572-73, Abdullah Khan Uzbek seized Balkh which, along with Badakhshan, had served as a kind of buffer between the Mughals and the Uzbeks.
After the death of Shah Tahmasp (in 1576), there was political instability in Iran; hence, by understanding the situation, in 1577, Abdullah Khan II (Uzbek ruler) sent an embassy to Akbar proposing partition of Iran.
Akbar ignored this appeal (because of sectarian narrowness). A strong Iran was essential to keep the restless Uzbeks in their place. At the same time, Akbar had no desire to get embroiled with the Uzbeks, unless they directly threatened Kabul or the Indian possessions, which was the key to Akbar's foreign policy.
Akbar sent a return embassy to Abdullah Uzbek in which he asserted that differences in law and religion could not be considered as sufficient ground for conquest.
Abul Fazl mentioned that the Khyber Pass was built in such a way that a wheeled traffic can also pass through. It was done due to fear of the Mughals, the gates were usually kept closed.
Speculating an invasion from Badakhshan, Abdullah Uzbek created trouble among the tribesmen of the north-west frontier, which was executed by one of his trustworthy agents, Jalala who was a religious fanatic.
Because of Abdullah Uzbek’s action, the situation became very serious; therefore, Akbar had to action. It was during this expedition, Akbar lost one of his best friends, Raja Birbal.
In 1585, Abdullah Uzbek suddenly conquered Badakhshan; both Mirza Hakim (his half-brother) and his grandson sought refuge at Akbar's court and were given suitable mansabs.
Immediately after the Uzbek’s attack, Mirza Hakim died and then Akbar annexed Kabul and made his dominion.
Abdullah Khan Uzbek sent another embassy to the Akbar’s court; however, at this time, Akbar was at Attock (on the river Indus). Abdullah Khan revived the earlier proposal for a joint campaign against the Safavid power, and for opening the way for pilgrims to Mecca.
The Ottoman (Turkish) sultan had invaded northern Iran, and the Uzbeks were threatening Herat in Khorasan.
Akbar sent a long letter in reply to Abdullah Uzbek's proposal. He disapproved the Turkish action, and proposed to dispatch an army to Iran led by one of the royal princes to help.
Akbar, however, made no serious preparations to support the threat of a campaign in Iran. Abdullah Uzbek had invaded Khorasan even before Akbar's letter reached him and captured most of the areas be claimed.
Most likely, an agreement was made that defined the Hindukush as the boundary. Further, the Mughals gave their interest in Badakhshan and Balkh, which had been ruled by Timurid princes till 1585.
After conquering Qandhar in 1595, Akbar accomplished his objective of establishing a scientific defensible frontier.
Akbar remained in Lahore until 1598, and left for Agra only after the death of Abdullah Khan Uzbek. After the death of Abdullah, the Uzbeks broke up into contending principalities, and ceased to be a threat to the Mughals for a considerable time.
In 1649, the setback in Balkh region led to a revival of Uzbek hostility in the Kabul region and Afghan tribal unrest in the Khyber-Ghazni region emboldened the Persians to attack and conquer Qandhar. Collectively, all these were great threat for Shah Jahan; therefore, he launched three major campaigns, led by princes (of blood) to recover Qandhar.
The first attack was launched by Aurangzeb (popular as the hero of Balkh), with an army of 50,000. Though the Mughals defeated the Persians outside the fort, they could not conquer it in the face of determined Persian opposition.
After three years, Aurangzeb made another attempt, but again failed. However, in 1653, the most grandiloquent effort was made by Dara Shikoh, the favorite son of Shah Jahan.
Dara Shikoh had made a great attempt and even maintained his strong position, but ultimately, it was of no avail.
Because of the repeated attacks and subsequent failures, Mughals lost much more than the loss of Qandhar as a whole. Failure also stained Mughals’ prestige.
In 1680, the proud Ottoman (Turkish) sultan sent an embassy to Aurangzeb’s court and asked for support. This time, Aurangzeb decided not to repeat the futile contest on Qandhar issue, and hence, agreed for the diplomatic relations with Iran.
The basic foreign policy of Mughals was based on the defence of India, which was further strengthened by the diplomatic means.
In spite of the fact that there were (temporary) obstructions over the question of Qandhar; friendship with Persia was Mughals’ keynote.
Further, the Mughals had also emphasized on relations of equality with leading Asian nations with both −
The Safavids, who claimed a special position by virtue of their relationship with the Prophet and
The Ottoman sultans who had assumed the title of Padshah-i-Islam and claimed to be the successors of the Caliph of Baghdad.
The Mughals also used their diplomatic foreign policy to promote India's commercial interests. Kabul and Qandhar were the twin gateways of India's trade with Central Asia.
From the discussion above given, it is clear that the Mughals succeeded in maintaining a controlled frontier in the north-west, based on the Hindukush, on the one side, and the Kabul-Ghazni line, on the other. However, Qandhar remained as its outer bastion.