Things were out of control in 1947.
Indian officers of Army did not have much power at that time and British commanded our Armed Forces.
A fellow named Nehru was questioned by an Indian officer for his qualification to become PM.From that day onwards this man became enemy of Army and left it unarmed unprepared and gradually humiliated in protocol procedures because he projected Army as a ceremonial outfit and its need for what for when borders were quiet. A vague unimaginative person who ordered Army to evict Chinese in 1962 without preparation and without planning. A self styled great statesman of the world who infact was called running d..of imperialism and in private considered to be of not much significance.
Yet another fellow JB Kriplani started bullying Army officers and started ordering them to obey his orders as if 1947 independence had made him some kind of dictator. The British General who was sitting with him snubbed this fellow Kriplani not to misbehave and not to give wrong orders to an officer who in no way was under his command.
Our military leaders true to their path and discipline did not over react or act against Nehru because people of India were under magic spell of Nehru due to his pre independence aura and also due to extraordinary success of First Five Year Plan which resulted thereafter in massive influx of people into India. Even those who had left India allegedly started tricking in. There after Second and subsequent Five Year Plans failed.
Army was never prepared nor had contingency plans for military take over due to lack of over ambitious Generals and lack of public support.
Nehru did provide stability, peace and started heavy industries. The country was carefully divided into a federation which acted as a cushion against military take over as political stability did not permit any space for Army rule.
Army take over is certain and inevitable and descend itself without asking in event of internal civil strife or chaos, the kind of thing engineered by Western powers in Myanmar recently.
Second is economic collapse, thirdly failure of administrative and judicial system or in presence of treason by top political leadership and change of demography.Moment India's demography changes alarmingly and political leadership of country goes into wrong hands, no force in world would be able to stop military take over resulting in war with hostile neighbouring countries in East and West of India which would automatically result in mass expulsions.This was the case during Ottoman rule and during the rule the rule of Stalin aftermath of war. The constant several billion dollar programme by West Asian countries in collusion with forces in Pakistan and Bangladesh to settle millions in India through hook or crook by collaborators would result in backlash and would be counter productive.
Army take over can not be imposed in country without solid reason and those reasons have no existence in absence of total failure of the state.