Brief History of India Pakistan wars over Kashmir
Pakistani Army, in October 1947, supported some irregular forces which invaded Kashmir in an attempt to annex it. Maharaj Hari Singh, the ruler of Kashmir, had not decided till then that to whom with he will join. Pakistan believed that they will be supported by the Muslim population of Kashmir, which didn't happen. Pakistan sponsored attack led the Maharaja to sign a treaty with India and (this is where article 370 comes into play), which provided basis on which the Indian Army entered the Kashmir to fight the invading forces. Although the Indian Army gained control of the Kashmir valley, some portion of Kashmir remained occupied by Pakistan. The fighting comes to end when UN sponsored cease fire agreement of January 1949, which is violated frequently. India refers to the part of Kashmir controlled by Pakistan as Pakistan Occupied Kashmir, and Pakistan calls it as "Azad Kashmir". This division of Kashmir planted the seeds for future conflicts between the two countries.
The War of 1965
In 1965, two military operation was launched by Pakistan. In the first operation which was named as Gibraltar, Pakistan sent armed infiltrators into Kashmir with orders to foment an armed rebellion among the Muslim population, which would then welcome Pakistani intervention. In operation Grand Slam, Pakistan sent armored units across the international border near Jammu to sever Kashmir from land communication with India. However,there strategy did not work, as Muslim population did not rebel against Indian Army, in fact, they provided the early warnings to Indian Army about the invasion of Pakistan. Indian troops defeated Pakistani forces in Kashmir.
The Kargil War, 1998
Irregular and regular forces from Pakistan invaded Kashmir in 1998, through the Kargil sector. These forces occupied tactically important heights along the line of control between India and Pakistan and also advanced into Indian territory. Like other wars, India removed the Pakistani army from the Kargil sector.
Insurgency in Kashmir
Discontent in the population regarding the political and economic failures of the Kashmir state government and central government initiated insurgency in Kashmir in the mid to late 1980s. Frustration and anger over lack of economic development, high levels of unemployment, nepotism and corruption, and allegations of election rigging manifested in the mid 1980s in strikes, public protest and sporadic terrorists violence. People lost their faith in government as it also had lost its ability to govern in effective manner.
Jammu Kashmir Liberation Front (JKLF) started attacking government officials, offices, and institutions in Kashmir, it was seen as the first sign of insurgency in the valley. The JKLF was founded in 1964, it had engaged in terrorist activities prior to leading insurgency. Pakistan's ISI was helping JKLF by providing the JKLF with military assistance. However, the JKLF was not Pakistan's puppet. Their only aim was the independence of Kashmir, including the parts of Kashmir controlled by Pakistan. When Pakistan realised that JKLF will not help them in capturing Kashmir, they started strengthening ties with other Kashmiri terrorist groups, particularly the Hizb-ul-Mujahideen and used these groups for destroying JKLF. Hizb-ul-Mujahideen sought through armed struggle to capture Kashmir from India and its merger with Pakistan.
Pakistani intervention in the conflict
Pakistan's intervention in the insurgency transformed it in the proxy war waged by Pakistan against India. JKLF and other groups exploited the growing social and economical discontent in Kashmir. Pakistan used the tactics of Muslim militancy in Kashmir and spread the concept of Jihad with its false interpretation. ISI had supported Islamic Jihadis who defeated the Soviet Union's attempt to capture the Afghanistan.
Pakistan applied the same strategy here on Indian controlled Kashmir. Some Islamist group empowered by the Afghan conflict like Al Queda, extended its support to numerous Islamist groups in Kashmir, including Harkat-ul-Mujahideen, Harkat-ul-Jihad, Harkat-ul-Ansar, Lashkar-e-Toiba and Jaish-e-Mohammed. Pakistan did not gave much importance to any particular group, in order to prevent one group from becoming dominant and thus threatening Pakistan's control over them. The shift from insurgency to a predominantly external endeavor can be seen in causalities statistics from violence in Kashmir. The percentage of foreign terrorists killed by Security forces increased from a low 0.2% to 82.5% in 2004. Which reveals the extent of external intervention in Kashmir.
Gradually as the response of Indian government improved in Kashmir, insurgency became more Pakistanize. The insurgency got more disconnected from local people and also from the source of the original insurgency movement, the Kashmiriyat, or the soul of Kashmir. Growing attacks on Muslim was the evidences of this disconnection. As the local support was evaporating, the ISI had little choice but to increase the use of Pakistanis and militants from other Islamic countries to keep the strategy alive. .
So Pakistan, instead of giving attention to their socio-economic problems, is indulging in some evil deeds, and does not want to end the tension between two countries. However, recent successful election in Pakistan has provided some hope for the improvement of the relationship between countries. A lot depends on new government that how it handles the matter.