In October 1947, the local ruler chose to join India, leading to the outbreak of war. However, in 1949, both sides agreed to a ceasefire and accepted the division of Kashmir.
Out of the four total* India-Pakistan wars (1947, 1965, 1971, 1999), three were fought over Kashmir, and one was fought over Bangladesh (1971).
Today, both countries claim the entire region but only control parts of it—referred to as “Indian Kashmir” and “Pakistani Kashmir.” A small portion is controlled by China.
*In 2001, they came very close to another war (nuclear), which was averted by the United States.