In the 1000 and 1100s there were invasions on the north from the Middle East, which converted a significant minority of the people to Islam, but these invaders lost most control as they tried to invade southern India while maintaining their growing empire.
Meanwhile the south, which had been predominantly Hindu for centuries, remained primarily divided into small areas ruled by various leaders, but thrived through Indian Ocean trade. The south, for much of this time had remained out of the reach of invaders, including the Muslims, until the 1300s when it was invaded by a number of groups and opened the area up to the growth of larger kingdoms.
In the 1500s the Muslim Mughals took power in India, their empire covering nearly the entire Indian subcontinent. Although best known to many people as the builders of the Taj Mahal, the Mughals proved to be a military, political, and cultural power, expanding the people's general well-being and even creating peace between the Muslims and Hindus, instead of trying to suppress the Hindus. This empire declined beginning in about 1700 and only 40 years later the Persians successfully invaded.
In about 1500 the Portuguese landed in India (Goa) and secured control over Indian Ocean trade with posts throughout the Middle East and Africa. The British arrived enforce in about 1600, first setting up trading posts with local leaders ruling over the people, then creating an official colony in 1858. The British vastly improved India's unity by building better infrastructure and communication networks, including the teaching of English as the language of communication.