After Independence, the Indian National Congress was confident of winning a General Election because of its superb grass-roots network and system of patronage.
Moreover, Nehru understood that it was his enemies on the Right who had most to lose from free and fair elections while his friends on the Left, outside the Congress, stood most to benefit.
Convincing election victories- in which the main opposition was visibly Leftist- gave the Indian regime great legitimacy. There could be no question of an Army coup because the Sandhurst trained General Staff had less influence over the NCOs than their 'gram sarpanch' (village headman) who was probably already part of the Congress machine.
In Pakistan, the situation was very different.
Jinnah and Liaqat's Muslim League had successfully played the 'Islam in danger' card but there was no way they could carry East Bengal- which had the majority of voters and whose politicians were far more like their counterparts across the border.
Even within West Pakistan, immigrant politicians like Liaqat were at a disadvantage. The Muslim landed gentry preferred to deal with Aristocratic Premiers, like Tiwana, as opposed to verbose middle class lawyers .
On the other hand, the military- because their officers were rewarded with generous land grants (something which didn't happen in India)- had to work with the 'feudal' land-lords and accommodate their interests.
In any case, after the assassination of Liaqat, the Muslim League had no West Wing leaders of stature who were not disqualified by reason of Religious affiliation.
In the event, a former soldier turned Political Service officer rose to the top but his unpopularity was such that the ambitious Army Chief had no difficulty packing him off to exile.
What alternative was there to the Army? The politicians wouldn't hold elections and thus secure legitimacy because they would lose. The Civil Service had no link to the grass-roots. By contrast, the Army had a network which reached down to the villages. Thus General Ayub Khan saw it as sponsoring something called 'Basic Democracy'. However, elections were still represented a source of danger.
Fatima Jinnah, the elderly sister of the founder of the country, did surprisingly well by falsely claiming that Ayub had sold out to the Indians on the Indus water issue.
Democracy wasn't good for Pakistan. It split the country and then enthroned a paranoid dictator. The Army had to step in to hang him by the neck simply to save their own skins.
In contrast to India, the Pakistani political class had not developed esprit de corps by sharing jail cells nor had they established a personal reputation for self-sacrifice.
By contrast, the Pakistani soldier- however much he might enrich himself- needed to have shown courage in battle simply so as to be accepted by his peers. Thus, disillusionment with elected politicians, who enrich themselves unconscionably, always leaves a window open, in Pakistan, for military intervention because there literally is no alternative.