Why did large numbers of Hindus and Muslims migrate after India's independence?

The Muslims and the Hindus are two different nations. They follow different religions. Their traditions, culture, customs, ideals and beliefs are totally different. Tey neither inter-dine nor inter-marry. When India was divided, riots broke in the subcontinent. The fear of loss of life and wholesale killing of one nation at the hands of the other made this large scale migration take place.

Muslims wanted to be in the Islamic Republic of Pakistan, where, ostensibly, they would live better lives than under Hindu-majority India. Conversely, Hindus wanted to flee the Muslim-majority regions of Pakistan (both West and East Pakistan) in order to be safe under Hindu-majority government. As luck would have it, Muslims in India have generally fared better than Muslims in Pakistan and Hindus in Pakistan suffer far more than either group in India.