When President Xi Jinping announced in 2015 that China would pump $46 billion worth of investments into Pakistan, the recipients of his largesse seemed less surprised than one might have expected. The military and political elites of the Islamic Republic of Pakistan have long extracted aid from outside powers in return for keeping a lid on things at home. As far back as April 1948, barely eight months after independence, Prime Minister Liaquat Ali Khan assured Pakistani military commanders that three-quarters of the new nation's budget would be devoted to defense -- fully expecting that the U.S. would underwrite the pledge.Xi will no doubt tout the Pakistan investments -- which include a network of road, rail, power and port projects that are collectively known as the China Pakistan Economic Corridor, or CPEC -- at his massive "Belt and Road" conference later this month. The Chinese argue these projects won't just link China to markets and suppliers from Europe to Southeast Asia, but also promote stability and development in the countries on its periphery. Indeed, even the International Monetary Fund hopes that China's billions will ease Pakistan's chronic supply-side constraints and perhaps reduce the pressure on the country's development budget.That, however, reflects the sort of blind optimism to which Pakistan's U.S. sponsors have succumbed for decades. If the Chinese aren't careful, they, too, will find that their money has bought them little more than headaches.As part of CPEC, Chinese loans will flow into Pakistan for urban transport infrastructure, for power plants and for ports and highways. The first tranche focuses on power -- $18 billion is earmarked for the sector, particularly for coal-fired plants -- and $10 billion has been promised for highways, ports and Pakistan Railways.China usually struggles to live up to such big promises, of course. But the numbers being bandied about have already seized Pakistan's imagination. Sectors like cement have started growing in response, boosting the Karachi Stock Exchange, which was the world's best-performing last year. Real estate prices have increased, too.For China, the benefits of the corridor seem obvious. Much of its grand strategy rests on trying to avoid the "Malacca dilemma": 80 percent of its oil, and much of its trade, flows through a narrow chokepoint at the Straits of Malacca that would be dangerously easy for the U.S., say, or India to blockade. One way to reduce that dependence would be to land oil or goods at China's new Arabian Sea port at Gwadar, in Pakistan's Balochistan province, and move them overland to Xinjiang province. In the process, Chinese analysts insist, China might well be able to improve Pakistan's economy, stabilize its politics and render it a bit less troublesome than it currently is.Such reasoning overlooks several lessons of the past. The first: Don't ignore Pakistan's domestic politics. Already the whole program has become tangled in an internal tug-of-war. Leaders from restive Balochistan complain that CPEC, which was originally supposed to run mostly through their province and neighboring Khyber Pakhtunkhwa, now looks to benefit mostly the richer eastern provinces of Punjab and Sindh. Protesters say the route was changed to benefit Punjab in particular; the province is the stronghold of Prime Minister Nawaz Sharif and is ruled by his brother Shahbaz.For the Chinese, these are uncharted waters. They will have to balance gains to the ruling elites in Islamabad and Lahore with those to the locals in Balochistan, who are more than capable of violently disrupting work on the corridor. If China fails to do so, Pakistan will end up more unstable, not less.The second lesson is to beware of the Pakistan army. Decades of foreign support have only further entrenched the military at the center of not just Pakistan's state, but its economy and society.Pakistan is noisy and disputatious enough to make Chinese planners wonder whether the army might not make a better partner than the civilian government or the private sector. Already, CPEC has exacerbated civil-military disputes in a country that saw its first peaceful democratic transfer of power only a few years ago. Military organizations have begun much of the corridor's work, especially road-building. CPEC was at the top of the agenda when Pakistan's army chief visited Beijing last month. And the army has cited the task of securing the corridor as an excuse to raise an entire new division of nine battalions and six "civil wings."The pattern is familiar to many in Washington: Money sent to Pakistan has a habit of winding up further bolstering the army's power. Meanwhile, the civilian government is quietly but rapidly losing enthusiasm for CPEC projects, which it correctly recognizes may wind up draining its resources instead of increasing them. For two successive years, the government has stepped in to reduce the amount of Pakistan's own money committed to the corridor.The stronger the army, and the weaker the incentives for the civilian government to open up the economy to countries other than China, the less likely Pakistan is to prosper in the coming decades. There's no question a more stable and prosperous Pakistan is vital for South and West Asia, for China and for the world. But it's far from certain that CPEC will produce one.This column does not necessarily reflect the opinion of the editorial board or Bloomberg LP and its owners.

(Mihir Sharma is a Bloomberg View columnist. He was a columnist for the Indian Express and the Business Standard, and he is the author of "Restart: The Last Chance for the Indian Economy.")