After the death of Emperor Aurangzeb in 1707, the empire was caught up in a succession crisis. With one notable succession, none of the remaining emperors could hold onto power for more than a decade, making strong, consistent leadership a thing of the past. There were also successive invasions from both the Persian and Afghan Empires to the east. Eventually, the weakened empire agreed to “protection” from the powerful British East India Company, who used their influence to effectively rule certain parts of India while the ailing empire held only a few areas around New Delhi. The British were always courteous to the Mughal rulers, but there was no question about who really controlled the western parts of India.
When the Sepoy Rebellion broke out in 1857, the British government stepped in and all power was transferred to the crown, shoving the last Mughal emperor aside. The last deposed emperor died in Burma in 1862.