History:
British rule began in 1757. The East India Company (EIC) took control in India till 1857. British crown, then, dethroned the EIC during the Indian Mutiny in 1857-58. The Indian Independence movement began in the mid 19th century. The movement was led by Mahatma Gandhi. He led through various movements like a method of nonviolent, non-cooperation movement, and the Civil Disobedience Movement.
In the year 1946, the British government underwent capital loss during the Second World War (WWII). The British Labour Government planned to end its rule over India. The then British PM Clement Atlee announced that the British rule would end in India by 30 June 1948. He also announced powers would be transferred to responsible Indian hands. On the other, the Muslim League demanded the partition of the country, which is Pakistan. But, on the midnight of 14-15 August in 1947, the British rule came to an end, and power was transferred to the two new independent Dominions of India and Pakistan.
source https://naukri.sarkari-exam.in/india-celebrated-its-74th-independence-day-on-15-august/