In the fourteenth century, the disintegration of the Mongol empire led Timur to unite Iran and Turan under one rule.
Timur's empire was spread from the lower Volga to the river Indus, including Iran, Asia Minor (modern Turkey), Trans-Oxiana, Afghanistan, and some part of Punjab.
In 1404, Timur died and Shahrukh Mirza, his grandson, succeeded his empire.
Timur gave patronage to arts and letters and he promoted Samarqand and Herat as the cultural centers of West Asia.
During the second half of the fifteenth century, the power of Timurids declined, largely because of the Timurid practice of partitioning of the empire.
The various Timund territories that developed during his time, were kept fighting and backbiting to each other. Their conflicting acts gave an opportunity to two new powers to come to the forefront −
The Uzbeks − In the north, the Uzbeks thrust into Trans-Oxiana. Though the Uzbeks had become Muslims, but Timurids looked them down because they (Timurids) considered them to be uncultured barbarians.
Safavid Dynasty − In the west (i.e. Iran), the Safavid dynasty appeared. They were descended from an order of saints who traced their ancestry to the Prophet.
Safavids dynasty promoted the Shi’ite sect among the Muslims, and persecuted to all those who were not ready to accept the Shia views.
The Uzbeks, on the other hand, were Sunnis. Thus, the political conflict between these two elements was estranged on the basis of sectarian views.
The power of the Ottoman Turks had escalated in the west of Iran and they wanted to rule Eastern Europe as well as Iran and Iraq.
In 1494, Babur, at the young age of merely 14, succeeded to Farghana. Farghana was a small state in Trans-Oxiana.
Shaibani Khan, the Uzbek chief, defeated Babur and conquered Samarqand.
Shaibani Khan, in a short span of time, besieged the most of the Timurid kingdoms and forced Babur to move towards Kabul.
In 1504, Babur conquered Kabul; at that time, Kabul was under the rule of the infant heir of Ulugh Begh.
Almost 15 years, Babur struggled hard and kept attempting to re-conquest his homeland from the Uzbeks. He approached the ruler of Herat (who was also his uncle) for the help, but he did not receive any positive response.
Shaibani Khan defeated Herat, which led to a direct conflict between the Uzbeks and the Safavids because Safavids was also claiming Herat and its surrounding area, namely Khorasan.
In the battle of 1510, Shaibani Khan defeated and killed by Kasim Khan.
By taking the help of Iranian power, Babur attempted to recover Samarqand. As a result of this, the Iranian generals wanted to treat Babur as the governor of an Iran rather than as an independent ruler.
After the massive defeat, the Uzbeks swiftly recovered; resultantly, Babur had been overthrown again from Samarqand and he had to return back to Kabul.
Shah Ismail (Shah of Iran) was defeated in a battle by the Ottoman sultan; the changes in geo-political scenario forced Babur to move towards India.
Once Babur said that from the time he won Kabul (i.e. in 1504) to his victory of Panipat, he had never ceased to think of the conquest of Hindustan.
Timur, the ancestor of Babur, had carried away a vast treasure along with many skilful artisans from India. The artisans helped Timur to consolidate his Asian empire and beautify the capital. They (the artisans) also helped Timur to annex some areas of Punjab.
Abul Fazl, the contemporary historian said that "Babur ruled over Badakhshan, Qandhar, and Kabul which did not yield sufficient income for the requirements of his army; in fact, in some of the border territories, the expense on controlling the armies and administration was greater than the income".
Babur was also always remained apprehensive about an Uzbek attack on his territory Kabul, and hence, considered India to be a safe place of refuge, as well as a suitable base for operations against the Uzbeks.
By the time, the political scenario of north-west India was much suitable for Babur's entry (into India).
In 1517, Sikandar Lodi had died and Ibrahim Lodi (his son) had succeeded him.
Ibrahim Lodi was an ambitious emperor whose efforts to build a large centralized empire had alarmed the Afghan chief as well as the Rajputs.
Daulat Khan Lodi was one of the most powerful chiefs of his time. Though, he was the governor of Punjab, but he was almost an Independent ruler.
Daulat Khan wanted to conciliate with Ibrahim Lodi; therefore, he sent his son to his (Ibrahim’s) court to pay homage. However, he was also intended to strengthen his power by annexing the frontier tracts of Bhira.
In 1518-19, Babur seized the powerful fort of Bhira and sent letters as well as verbal messages to Ibrahim Lodi and Daulat Khan. Babur asked them for the cession of all those areas, which had belonged to the Turks.
Daulat Khan detained Babur's envoy at Lahore, neither granted him audience nor allowed him to go and meet Ibrahim Lodi. Daulat Khan expelled Babur’s agent from Bhira.
Once again in 1520-21, Babur crossed the Indus, and easily clutched Bhira and Sialkot (popular as the twin gateways to Hindustan) and then, Lahore was also surrendered to him.
After capturing Bhira and Sialkot, Babur planned to proceed further, but because of the revolt in Qandhar, he returned back.
Babur recaptured Qandhar after almost one and half years. His political stability again encouraged him to move towards India.
Daulat Khan sent Dilawar Khan (his son) to Babur’s court and invited Babur to come India. Daulat Khan suggested Babur to replace Ibrahim Lodi, as he (Ibrahim Lodi) was a tyrant ruler.
Rana Sanga (Rana of Mewar), most likely at the same time, also sent a message to Babur inviting him to attack India. Two embassies from the powerful kingdom convinced Babur to conquest India again.
In 1525, when Babur was in Peshawar, he received a message that Daulat Khan Lodi had changed the sides.
Daulat Khan had collected an army of 30,000-40,000 men and ousted Babur's soldiers from Sialkot, and tried to advance towards Lahore. However, as Babur came, Daulat Khan’s army ran away; resultantly, Daulat Khan got surrendered and was pardoned. Babur became the ruler of Punjab.