The Mughal Empire collapsed because it was weak and many small states broke away from Mughal rule. This allowed the East India Company to gain control.
The East India Company gained control over India and had lots of power. This control was obtained after the Mughal Empire fell.
The Sepoy Mutiny occurred and uprisings spread over much of northern India. These Rebellions led to British gaining control (Raj), states being claimed to remain independent but the British continuing to gain power, and distrust and racist attitudes towards British and Sepoys.
The "Jewel in the Crown"
When the cash crops (cotton) had started, villagers were no longer self-sufficient. Food production began to decline and famine began to set in.
The British Partition divided Hindus and Muslims into sections. There were difficulties uniting to gain independence. British took back order in 1911 and divided province differently.
After the Sepoy Rebellion, the British government decided to take more direct control over India. The government feared losing control over the "Jewel in the Crown" of their empire. India had the most valuable of British colonies, a major supplier of raw materials, and a large population which meant there was a large potential market.