[citation needed] The Afghan-Mughal Wars had their roots in the complex political and military history of the Indian subcontinent in the 16th century.
The Mughal Empire, under the leadership of Emperor Babur, had established its rule in northern India by defeating the Delhi Sultanate in 1526.
However, the Mughals faced constant threats from various regional powers, including the Afghans, who controlled parts of present-day Afghanistan.
Between Babur's fledgling Mughal Empire and the Lodi family-run Delhi Sultanate, there was a significant conflict known as the first phase Mughal-Afghan War that started in 1526.
[7] The founder of the Mughal Empire and a descendant of Genghis Khan, Babur saw a chance to extend his realm and launched an invasion of India.
[9] The Mughal army's superior firepower and discipline, as well as its access to cutting-edge weapons like muskets and artillery, rendered the Lodi forces helpless against them.
During the reign of Emperor Akbar, the Mughal Empire launched several military campaigns against the Karrani dynasty in an effort to expand its territory and assert its authority over Bengal.
[19] In 1575, the Mughals under the command of the governor of Bihar, Todar Mal, marched into Bengal and engaged the Karrani forces in a series of battles.
[20][21] The Roshani movement played an important part in politically in resisting the increasing influence of Mughals in Afghan region as they gained popular supports from the Afghanis.
[21] His successors continued his struggle against the Mughals, and even captured Ghazni city at one point, prompting emperor Jahangir to deal with the rebellion more seriously, which after constant battles against the sect, the movement eventually weakened and ended.
[27] It was in light of this close alliance that Islam Khan I, the Mughal governor of Bengal, dispatched an imperial force against Bayazid so as to prevent the latter from providing aid.
[41] Akbar learned about the disaster two days later and an army under Rajah Todar Mal set off on 19 February to exact retribution against the Yusufzais, killing a large number of them and selling many survivors to Turan and Persia, as "the countries of Swat, Bajaur and Buner were cleansed of evildoers.