While he was dithering between joining India or becoming an independent country, the Pakistani army attacked Kashmir from the west, thinking it would be a quick battle. But the King of Kashmir asked India for help. India agreed to help on the condition that Kashmir would be part of the Indian Republic. The king hastily signed a document agreeing to join the union of India. The Pakistanis felt that he had no right to do that since the majority of his subjects were Muslim and would have sided with Pakistan and appealed to the international community to restore Kashmir to Pakistan, or let the people have their say. However, in the eyes of the world, Pakistan had forfeited any moral high ground because of their treacherous attack on an unguarded kingdom. So though they tried hard to get the United Nations involved later, they never mustered any international backing to thier cause. IT left them feeling bitter and frustrated and they felt the whole world was against them and had unfairly sided with India.
After the 1947 war, India controlled the best parts of the Kashmir valley (Jammu and Kashmir) and Pakistan occupied the rest, which is mostly uninhabitable. The recent devastating earthquakes in 2006 were almost entirely on the Pakistani side of Kashmir.
Pakistan's founding politicians were so bitter that they swore a 'thousand year struggle' to get Kashmir 'back' from the Indians. Though, in the intervening sixty years, most Pakistanis have lost any hope of getting it 'back', and also have lost