This refers to the disputed status of the erstwhile Princely State of Jammu & Kashmir, the cause of three of the four wars fought between India and Pakistan since independence.
We begin in 1948, just after the Partition of British India into modern day India and Pakistan, with the princely states of the subcontinent that until then had been autonomous to the rest of the British land holdings in the subcontinent and nominally independent. With the creation of the two new dominions, these states were all given a choice: Go to India, go to Pakistan, or be independent. The third option was often a false choice, since most of the 600 or so princely states were too small to sustain themselves without the support of the British or the new native-ruled central governments. As such, most of these states went quietly to one or the other. Of the rest, most joined out of genuine interest in bringing forth India and Pakistan into reality and gave up their realms willingly even if they could have survived on their own. A few, however, for a variety of reasons, decided to hold out. One of these was Kashmir.
The Princely State of Jammu and Kashmir came into existence in the 19th century at the defeat of the Sikh Empire to the British. The Dogra clan, which had been essential to this victory, were given the northern territories of the former Sikh Empire by the British to govern. At the time it didn't matter much, as with the British controlling everything one Maharaja was as good as another. However, when it became clear that they were going to quit India in 1947 the Maharaja of Kashmir at the time, Hari Singh, was faced with a dilemma: the clan he was head of, the Dogras, were Hindu but their subjects were mostly Muslim. In lieu of the rising political temperature with the Pakistan Movement his own population began demanding he accede to Pakistan. The problem with this was that, as a Hindu ruler, his family would be left out of the political loop entirely (unlike in other princely states, where the princes often served as the first governors of the area or as part of the Parliaments of either India or Pakistan), and would perhaps be forced to give up their personal assets as well. On the other hand, to chose to join India would have sparked a revolution, and he'd lose there too.
So instead, he decided that Kashmir would be an independent state. As a strategically located entity of considerable size and economy, Kashmir could pull it off. Less than a year after the choice, this independence was put to the test. Afghan tribal armies known as "lashkars" began an assault on the Kashmir State Forces in North-West Kashmir near the city of Gilgit. Almost at once, the garrison protecting Gilgit, the Gilgit Scouts, revolted and proclaimed loyalty to Pakistan, which was believed to have supported these lashkars. Soon the nearby vassal states of Hunza and Nagar independently pledged their loyalty to Pakistan as well, and it became clear that the Maharaja's forces were about to be routed. In desperation, Maharaja Hari Singh appealed to India to step in and assist. Indian Prime Minister Jawaharlal Nehru agreed on the condition that Kashmir accede to India. Having little choice in the matter Hari Singh agreed and soon his state forces were officially absorbed into India, and New Delhi joined the fight. So began the First Kashmir War. This ended early in 1948 in a ceasefire that divided Kashmir in two, with a large chunk of northern Kashmir in Pakistani hands along with a smaller, but more populated, sliver of the western edge of the princely state. This ceasefire line has remained in place since then with little variation.
The second war would not occur until 1965, when Pakistan's military dictator, Field Marshal Ayub Khan, believed a surprise attack would germinate into a local Kashmiri revolution, which together would then create enough momentum to catch the Indians by surprise and drive them out of Kashmir before they could fight back. Part of this idea came from India's performance in the 1962 Sino-Indian War, in which the Indians were overwhelmed by the Chinese surprise attack that only ended when China withdrew of its own accord but not without taking a portion of Kashmir for itself, this time in the eastern edge of the state. Considering this proof of India's vulnerability, Khan went ahead with his plan. Unfortunately for him and Pakistan, the Kashmiri Revolution that was supposed to get kicked off with the surprise attack never happened. Instead, the locals helped the Indian army in getting proof that it was Pakistan trying to instigate something. So began the 1965 war which resulted in India pushing the Packistanis back out of Kashmir...and nearly capturing the major Pakistani city of Lahore in the process. This war also ended in stalemate, though its political ramifications would be felt far and wide. It ended Ayub Khan's career, who then transferred his role of military dictator to the next man down in the ruling junta's ranks: General Yahya Khan.
The war also proved to the Bengalis of East Pakistan once and for all that they were not seen as important to Pakistan (hardly anything was dedicated to its defense during the war, with the military taking the doctrine of "the Defense of the East lies in the West"). This, along with various other problems including language and ethnicity, set off a separatist conflict with Islamabad, leading to a crackdown, which in turn lead to Indian involvement and the Bangladeshi Liberation War, better known as the Indo-Pakistani War of 1971. While this conflict had nothing to do with Kashmir, fighting occurred there as a matter of course, in the belief that India would sue for peace if its portion of Kashmir was taken. India instead held the Pakistanis in Kashmir while, with the aid of the Bangladeshi militias, they steamrolled over the poorly defended East in under two weeks. The stakes in the conflict in Kashmir were heightened when India got the Atomic Bomb in 1974. Then the Indian Army took over the Siachen Glacier area of Kashmir in 1984 (the status of the area had not been resolved in the previous cease-fires and so taking it was not technically illegal). In the 1990s, Pakistan used terrorists in Kashmir to once again try to start a revolution, with very mild success. In 1998, both sides tested nuclear weapons, ending any possibility of another war.
Enter General Pervez Musharraf, Pakistan's future dictator. He became the mastermind of the 1999 Kargil War.