Apart from the disastrous invasion by the Afsharid ruler of Iran, Nader Shah in 1739, the Mughals were successfully contested by the Marathas.
However, able rulers such as Hyder Ali and Tipu Sultan transformed the kingdom and westernized the army & it soon turned into a military threat both to the British and the Marathas.
In 1769 Hyder Ali made his way to Madras (the location of the Company's government) and demanded a peace treaty.
[6] After the Second Anglo-Mysore War, the son and successor of Hyder Ali the new ruler of Mysore Tipu Sultan, sought to keep offensive moves by the Marathas at bay.
The Maratha had established a military alliance with the ruler of Hyderabad with a common purpose of recovering territories both sides had lost to Mysore during previous conflicts.
The Marathas also attempted to draw the British East India Company into the pending conflict, but a neutrality policy implemented by the new governor-general, Lord Charles Cornwallis made its participation difficult.