At the time of independence, India comprised two categories of political units, namely, the British provinces (under the direct rule of British government) and the princely states (under the rule of native princes but subject to the paramountcy of the British Crown).
The Indian Independence Act (1947) created two independent and separate dominions of India and Pakistan and gave three options to the princely states which are: joining India, joining Pakistan or remaining independent.
Of the 552 princely states situated within the geographical boundaries of India, 549 joined India and the remaining 3 (Hyderabad, Junagarh and Kashmir) refused to join India.
However, in course of time, they were also integrated with India–Hyderabad by means of police action, Junagarh by means of referendum and Kashmir by the Instrument of Accession.