After the death of Shivaji, his son Sambhaji became the king of Marathas. He continued the attacks on Mughal territories. At that time, both Ahamednagar and Bijapur were annexed to Mughal empire. The Marathas were now the only enemy of Mughals.
The Mughal emperor Aurangzeb turned all his energy and attention to Marathas. Sambhaji was captured in 1689 and executed. His infant son Sahuji was taken captive.
The brother of Sambhaji, Rajaram took refuge at Jingee in the Konkan. The name of his son was Shivaji III who became the king of Marathas in 1700 while his mother Tarabai acted as his regent.
At this juncture, the Mughals released Shahuji which created a kind of civil war among the Marathas because both Shahuji and Tarabai claimed the Maratha throne. Shahuji with the help of Balaji Vishwanath emerged victorious.
Balaji Vishwanath was appointed Peshwa in 1713 by the Martha King Sahuji. The post of Peshwa became hereditary later on. Tarabai set up a rival centre at Kolhapur.