The British had been involved India since the 1600s, when the East India Company set up trading operations there to import silk, cotton, and spices. The company slowly took control of large parts of the country through economic means, until they exerted de facto control of India in the mid-1700s.
In 1857, Indians rebelled against this authority. The rebellion was suppressed, and the British Crown declared formal control of India.
Britain slowly released control over the country throughout the next 100 years. Formal independence was achieved in 1947, at which time the country split into India and Pakistan (Bangladesh would secede from Pakistan in 1971).