It is a combined effect of foreign invasions as well as, the areas of India itself attacked. For example, because of Shivaji, the Mughal empire in Maharashtra fell.
The Ottoman Empire had been in decline for a while in the 1800's with European and North African colonies gaining independence. There was a strong Turkish nationalist movement that wanted a secular...