The Mughal–Maratha Wars was a conflict between the Mughal Empire and the descendants of the Maratha ruler Shivaji from the time of Shivaji's death in 1680 until the death of Emperor Aurangzeb in 1707. Shivaji was a central figure in what has been called "the Maratha insurgency" against the Mughal state. Both he and his son, Sambhaji, or Shambuji, typically, alternated between rebellion against the Mughal state and service to the Mughal sovereign in an official capacity. It was common practice in late 17th-century India for members of a ruling family of a small principality to both collaborate with the Mughals and rebel.

Upon Shivaji's death in 1680, he was immediately succeeded by Rajaram, his second-born son by his second wife. The succession was contested by Sambhaji, Shivaji's first-born son by his first wife, and quickly settled to his benefit by the murders of Rajaram's mother, of the loyal courtiers favouring Rajaram's succession, and by Rajaram's imprisonment for the following eight years. Although Sambhaji's rule was riven by factions, he conducted several military campaigns in southern India and Goa.

Mughal–Maratha Wars

In 1681, Sambhaji was contacted by Prince Akbar, the Mughal emperor Aurangzeb's son, who was keen to renounce or resist his ageing father's authority by entering into a partnership with the Marathas. The prospects of an alliance incited Aurangzeb to move his household, court and army to the Deccan. Akbar spent several years under the protection of Sambhaji but eventually went into exile to Persia in 1686. In 1689 Sambhaji was captured by the Mughals, nd executed with some cruelty. Sambhaji's wife and minor son, later named Shahuji was taken into the Mughal camp, and Rajaram, who was now an adult, was re-established as ruler; he quickly moved his base to Gingee, far into the Tamil country. From here, he was able to frustrate Mughal advances into the Deccan until 1700.

Mughal–Maratha Wars

In 1707, Emperor Aurangzeb died. Although by this time the Mughal armies had regained total control over lands in the Deccan, their forts had been stripped bare of valuables by the exiting Marathas, who thereafter took to raiding Mughal territory in independently operating "roving bands." Sambhaji's son, Shahu who had been raised in the Mughal court received in 1719 the rights to the Chauth (25% of the revenue) and sardeshmukhi over the six Deccan provinces in exchange for his maintaining a contingent of 15,000 troops for the Mughal emperor.

Mughal–Maratha Wars

Marathas under Sambhaji (1681–1689)

Sambhaji, the eldest son of the Maratha warrior king Shivaji, was executed in 1689 at the age of 31. His death was a significant event in Indian history, marking the end of the golden era of the Maratha Empire. Sambhaji was born in 1657 to Shivaji and his first wife, Saibai. He was trained in the art of warfare from a young age and was known for his bravery and military skills. After Shivaji's death in 1680, Sambhaji ascended to the throne of the Maratha Empire. In the first half of 1681, several Mughal contingents were dispatched to lay siege to Maratha forts in present-day Gujarat, Maharashtra, Karnataka, and Madhya Pradesh. The Maratha Chhatrapati Sambhaji provided shelter to the emperor's rebel son Sultan Muhammad Akbar, which angered Aurangzeb. In September 1681, after settling his dispute with the royal house of Mewar, Aurangzeb began his journey to Deccan to conquer the Maratha lands, as well as the sultanates of Bijapur and Golconda.. He arrived at Aurangabad, the Mughal headquarters in the Deccan and made it his capital. Mughal contingents in the region numbered about 500,000. It was a disproportionate war in all senses. By the end of 1681, the Mughal forces had laid siege to Fort Ramsej. But the Marathas did not succumb to this onslaught. The attack was well received and it took the Mughals seven years to take the fort. In December 1681, Sambhaji attacked Janjira, but his first attempt failed. At the same time one of the Aurangzeb's generals, Husain Ali Khan, attacked Northern Konkan. Sambhaji left Janjira and attacked Husain Ali Khan and pushed him back to Ahmednagar. Aurangzeb tried to sign a deal with the Portuguese to allow trade ships to harbour in Goa. This would have allowed him to open another supply route to Deccan via the sea. This news reached Sambhaji. He attacked the Portuguese territories and forced them back to the Goan coast. But the viceroy of Alvor was able to defend the Portuguese headquarters. By this time the huge Mughal army had started gathering on the borders of Deccan. It was clear that southern India was headed for a large, sustained conflict.