This is why article 370 was created
Article 370 is one of the most controversial provision provided to Jammu and Kashmir, drafted under part XXI of the Indian Constitution. This Article provide special immunity to J & K and grant special autonomous status to the state. The Article 370 was created as an instrument to accede state of Jammu and Kashmir to the Indian Union.
From where this problem of article 370 arises? Lets dive deep into the history. It was the time when transfer of power was happening i.e when we were about to be accorded the freedom. On 20th February, 1947, His Majesty’s Government announced that independence would be given to British India, the plan was to create two independent dominions of India and Pakistan based on the Hindu and Muslim majority areas of the various provinces of British India. Policy framed by Britishers announced that with the withdrawal of paramountcy, the princely States would become ‘independent’. However neither the Cabinet Mission nor British government thought about the future of 562 independent princely states. The idea of 562 states exercising their own power was too dangerous and chaotic, civil wars was on the card, may be what Britishers would have wanted.
Situation was different with Jammu and Kashmir- the largest of the three. A Hindu ruler, Maharaj Hari Singh, were ruling over the majority of Muslim population. Pakistan soldiers along with Pathan tribesman invaded this state (Brief History of India Pakistan wars over Kashmir), creating chaos and spreading disturbances. In the state of panic he signed the agreement and accede to India, but unlike others he refuse to accept the constitution of India. He insisted that, as provided by clause 7 of the Instrument of Accession, it was not committed to accept the future Constitution of India. Instead, it decided to have its own separate State Constitution.
This stand of Jammu and Kashmir raised a major legal hurdle before the newly created nation, and hence, the Indian Constituent Assembly was compelled to make a special provision to cover the particular and exceptional case of Jammu & Kashmir. And that special provision is what we call today 'Article 370', which is a hot topic of discussion in political and social circles of India.