Why was India divided into two different countries when it won independence from Britain

India was divided into two different countries, India and Pakistan, when it won independence from Britain primarily due to religious tensions between Hindus and Muslims. The divide was based on religious lines, with the creation of a separate Muslim-majority country, Pakistan, to address the demands of the Muslim League for a separate homeland. This partition was a consequence of the complex religious, social, and political dynamics that had been building during the independence movement, leading to communal violence and fears of continued conflict. The Indian Independence Act of 1947 formalized the partition, resulting in the creation of the Dominion of India and the Dominion of Pakistan on August 15, 1947.