The British East India Company did not set out to conquer and rule India, nor did that situation manifest itself overnight, nor by any single battle or treaty.
- built ties with stable commercial interests in India, leaving the freedom to
act opportunistically in Indian politics as the Mughal Empire crumbled
- outmaneuvered European rivals in expanding and consolidating their presence
- amassed great wealth, increasingly taking on governmental and military functions to protect that wealth, and arguably becoming "too big to fail" for the British government
The Cambridge Concise History of Modern India is available online, and from where I draw most of the following.
Unlike China, which was first unified relatively early, no single kingdom in the Indian subcontinent predominated for long until Babur established the Mughal Empire in 1526. His successors expanded the empire across the subcontinent, but the realm was weak internally. Most regions were not ruled directly but through princely intermediaries who paid tribute, and Mughal rule (and misrule) was deeply resented. The empire was in sharp decline by the late 17th century.
The British East India Company's first conflicts were not with the Mughals or with the locals, but with other Europeans. The EIC defeated the Portuguese in a 1612 battle to gain a lucrative foothold in India, but found themselves in rivalry with not only the Portuguese but the Dutch and the French as well. As Mughal authority declined, English bases were raided more often, leading to company to hire security forces and arm its ships.
After the outbreak of the War of Austrian Succession in 1744, the French in Pondicherry intervened in succession disputes in Arcot and Hyderabad, backing one rival in exchange for favorable trade terms after that rival was in power. Having been in India for much longer, however, the EIC played this game better. They had maintained close ties with Indian financiers and producers, negotiated the most lucrative monopolies, and secured the best ports at Bombay (Mumbai), Madras (Chennai), and Calcutta (Kolkata). By the end of the Seven Years' War, although France and Portugal retained trading posts in India, Britain had no serious rivals for domination of the subcontinent, and thus there were no foreign powers with which local rulers could ally themselves to resist the British.
Direct Company rule is reckoned to have begun with the Battle of Plassey on June 23, 1757, when the EIC deposed the nawab of Bengal and installed a puppet. But again, things did not change overnight with Plassey. The EIC was extracting internal taxes and maintaining an army, but for a while it continued to collect those taxes through the nawab's agents, and acted in the name of the emperor. Judicial matters were left to the civil government. The Company's inexperience in running a state was highlighted in the Bengal famine of 1770, when as many as a third of the local population may have died.
What rule in Bengal did provide was control over what was then the richest part of India, giving it resources with which it could pursue its interests with aggression in the 19th century. By the time the notorious Doctrine of Lapse (whereby the EIC would annex lands whose rulers were deemed "incompetent" or who died without heirs) was promulgated in 1848, the Company had already extended control across India after a long series of wars and intrigues that would have been unimaginable a hundred years earlier— in the process overextending itself and requiring bailouts from Parliament, which in turn set the stage for its nationalization after the rebellion of 1857.