When the British withdrew from the Indian subcontinent in 1947, a negotiated settlement partitioned the land between the newly independent states of India and Pakistan. Autonomous states such as Kashmir were given the choice of where to go.
The ruler of Kashmir was Hindu, while the majority of his subjects were Muslim. The partition deal had given other Muslim-majority states to Pakistan, a nation created to allay Muslim fears of becoming a minority in a Hindu-led nation.
But the prince chose India, enlisting the country's help in repelling fighters from Pakistani territory. A United Nations-brokered cease-fire called for the withdrawal of Pakistani forces and the holding of a popular vote to decide the region's fate. But Pakistan did not remove its forces and India never held the vote.
Periodic wars between India and Pakistan over Kashmir have left the territory split between the two (as well as China), with a de facto border known as the "Line of Control."
In the 1990s, religious militants from Pakistan joined indigenous fighters to battle Indian forces. India then used that to define the conflict as terrorism against its people, taking the international spotlight off the Kashmir issue of independence.