Both India and Pakistan got independence at the same time and started their progress, but there is a clear contrast between Military's involvement in Politics/Establishment between the two countries.
Military Coups in Pakistan
1958 Coup - Sikandar Mirza dismissed the assembly and within fortnight got dismissed himself by Martial Law Administrator Ayub Khan.
1977 Coup - General Zia ul Haq dismissed the assemblies and ordered arrest of Bhutto, his ministers and other leaders - Bhutto would be hanged later on.
1999 Coup - Musharraf arrested Nawaz Sharif and his ministers.
Not only these, but there have been some unsuccessful attempts of coups as well.
Ironically, in 1971, president of Pakistan (Yahya Khan) was also a military general whose poor planning and diplomacy lead to huge loss of Pakistan.
Military Involvement in India
On the other hand, there hasn't been a single attempt of coups in India (as a funny contrast to Pakistan, there is not even a Wikipedia entry for that). Even Indira Gandhi is believed to have kept Gen Arora Singh standing for hours in her wait for just one statement post-1971 war while we never see Pakistani governments finding courage to see in the eyes of army?
And not only military coups, army always has been active in Pakistani establishment, why there is so much contrast in these two countries?