Following Aurangzeb's death there was a war of succession that ended with his son, Muazzam, being crowned the new emperor. Upon taking the throne, he took up the name Bahadur Shah. He was seen as a competent ruler.
Bahadur managed to achieve peace with the Sikhs, but it lasted less than a year when the leader of the Sikhs was assassinated. The man, Govind Singh, was the last Sikh guru and had become a leader in the emperor's army. When Singh was assassinated, it put the two parties back at war for three years before the Sikhs retreated to the hills for shelter.