Pakistan desired that Kashmir with a Muslim majority population should join the Muslim country, Pakistan. But the popular leader of the National Congress opposed Pakistan’s ideology.
According to India, Kashmir in its entirety belongs to India. India views the instrument of accession that was signed by Maharaja Hari Singh as legally binding, hence legally and fairly giving India Kashmir.
Further Reading :
To read more about Article 370, check the linked article.