Chinese President Xi Jinping stands on a military jeep as he inspects troops of the People's Liberation Army during a military parade in July 2017 (Xinhua via AP)

The Doklam debate has missed one key element: The mutual withdrawal deal was clinched just after Chinese President Xi Jinping replaced the chief of the People Liberation Army’s (PLA) joint staff department. This topmost position – equivalent to the chairman of the U.S. joint chiefs of staff – was created only last year as part of Xi’s military reforms to turn the PLA into a force “able to fight and win wars”.

The Doklam pullbacks suggest that the removed chief, General Fang Fenghui, was an obstacle to clinching a deal with India and probably was responsible for precipitating the standoff in the first place. Fang was fired just days after he hosted America’s highest-ranking military officer, General Joseph Dunford.

To be sure, this was not the first time that PLA belligerence in the Himalayas imposed diplomatic costs on China. A classic case was what happened when Chinese President Xi Jinping reached India on a state visit in September 2014. Xi arrived on Prime Minister Narendra Modi’s birthday with a strange gift for his host — a predawn Chinese military encroachment deep into Ladakh. The encroachment, the worst in many years in terms of the number of intruding troops, overshadowed Xi’s visit.

It is bizarre that the PLA would seek to mar in this manner the visit of its own head of state to a key neighbouring country. Yet Chinese Premier Li Keqiang’s earlier visit to New Delhi in 2013 was similarly preceded by a 19-km PLA incursion into another part of Ladakh that lasted three weeks.

Such provocations might suggest that they are intentional, with the Chinese government in the know, thus reflecting a preference for blending soft and hard tactics. But it is also possible that the provocations underscore the continuing “disconnect between the military and the civilian leadership” in China that then U.S. Defence Secretary Robert Gates had in 2011 warned about.

Xi’s purges of generals and admirals and other reform-related actions have been designed to consolidate his authority over the PLA and ensure that it does not blindside the government. But as Fang’s firing and other latest changes in the PLA leadership highlight, Xi is still working to bring the military fully under his control.

During his 2014 India visit, Xi appeared embarrassed by the accompanying PLA encroachment and assured Modi that he would sort it out upon his return.

Soon after he returned, the Chinese defence ministry quoted Xi as telling a closed-door meeting with PLA commanders that “all PLA forces should follow his instructions” and that the military must display “absolute loyalty and firm faith in the party.” He has conveyed that same message repeatedly since then, including recently on the 90th anniversary of the PLA’s creation. Had civil control of the PLA been working well, would Xi repeatedly be demanding “absolute loyalty” from the military or asking it to “follow his instructions”?

Under Xi’s two immediate predecessors, Hu Jintao and Jiang Zemin, the PLA gradually became stronger at the expense of the party. The military’s growing power has troubled Xi, a former military reservist whose present wife — folk singer Peng Liyuan — is a civilian member of the PLA, holding a rank equivalent to major general.

As part of his effort to reassert party control over the military and carry out defence reforms, Xi has used his anti-corruption campaign to ensnare a number of top PLA officers. He has also cut the size of the ground force and established a new command-and-control structure.

But just as a dog’s tail cannot be straightened, asserting full civil control over the PLA is proving very challenging. After all, the party is ideologically and morally adrift and depends on the PLA to sustain its political monopoly and ensure domestic order. The PLA, with its soaring budgets and expanding role to safeguard China’s overseas interests, sees itself as the ultimate arbiter of Chinese nationalism.

The structural change in China parallels what happened in Imperial Japan, which rose dramatically as a world power in one generation after the 1868 Meiji Restoration. Boosted by war victories against Manchu-ruled China and Tsarist Russia, the Japanese military gradually went on to dictate terms to the civilian government, with tragic consequences.

The PLA’s increasing clout has led China to stake out a more muscular role, including resurrecting territorial and maritime disputes, asserting new sovereignty claims, and using construction activity to change the status quo. It won’t be long before the PLA rekindles Himalayan tensions with a new encroachment.

China’s internal politics clearly has a bearing on its external policy. China’s prospective rise as a praetorian state will adversely affect the security of its neighbours.

Brahma Chellaney is a geostrategist and author

The views expressed are personal