By whatever metric you choose, China’s recent oil-drilling adventure in the South China Sea was a disaster. No new oil will reach Chinese consumers, no new maritime territory has been gained and regional advantage has been handed to the United States. ASEAN solidarity has held firm and the positions of ‘pro-Beijing’ forces in crucial countries, particularly Vietnam, have been seriously weakened. China’s foreign-policy making has proven to be incompetent. How did it all go so wrong?

We can’t know what the Chinese leadership hoped to achieve when it approved the deployment of the country’s largest oil rig and a small armada of protecting vessels into waters also claimed by Vietnam. It seems unlikely that the operation was simply an attempt to find oil. There are many better places to go prospecting. On March 19, the China National Offshore Oil Corporation (CNOOC) announced it had discovered a mid-sized gas field in uncontested waters closer to Hainan Island. Exploitation of that field was delayed while the Paracels adventure unfolded farther south.

The two areas of seabed explored by the giant drilling rig HS-981 are not good prospects for hydrocarbons. A 2013 report by the U.S. Energy Information Administration suggested the Paracels’ energy potential is low. It seems significant that CNOOC, China’s most-experienced offshore operator, was not involved in the expedition. Although CNOOC’s subsidiary COSL was operating the rig, the overall operation was directed by the China National Petroleum Corporation (CNPC) which has much less experience of exploration in the South China Sea.

HS981 ended its mission a month early, in the face of the impending arrival of super-typhoon Rammasun. CNPC declared that the rig had found hydrocarbons, but was very unspecific about details and amounts. It is almost certain that they will never be commercially exploited for both technical and political reasons. This operation was not really about oil.

One motivation can be safely ruled out. We know that the mission was not an attempt to rouse popular nationalist feeling in China because, as the Australian researcher Andrew Chubb has shown, news about the clashes between the rig’s protection fleet and the Vietnamese coast guard was kept out of the Chinese media for a week afterwards.

There may well have been another political purpose, however. An operation of such magnitude must have been planned well in advance and approved at the highest level. Chinese authorities announced that the rig had arrived on station on May 3, exactly one week before the summit of the Association of Southeast Asian Nations (ASEAN) was due to get underway in Myanmar. Perhaps Beijing was hoping to repeat its success at the ASEAN Foreign Ministers’ meeting in Phnom Penh in July 2012. On that occasion, ASEAN split: Cambodia vetoed a collective statement, leaving the Philippines and Vietnam isolated in their sea disputes with China.

If China was hoping to achieve the same thing over the Paracels, the effect was exactly the opposite. ASEAN came together in a conspicuous display of unity and issued a joint statement, in effect telling Beijing to back off. This was the first time the organization had taken a position on the Paracels—which is a purely bilateral dispute between China and Vietnam (unlike the Spratly Island disputes which affect five ASEAN members, including Indonesia). Andrew Chubb has argued that this quiet display of solidarity had much more of an impact in Beijing than the high-volume statements from Washington.

Some commentators have suggested that the episode was an example of “salami slicing”—a steady process of occupying areas of the South China Sea in small steps without attracting too much attention. But if that was the aim, it also failed since, with the withdrawal of the oil rig, the waters are, once again, unoccupied. The “slice” has rejoined the salami. The politburo may have thought that a decisive statement of maritime control would strengthen China’s territorial claim to the islands, but Vietnam’s robust response is equally good proof that it disputes that claim.

The Australian analyst Hugh White has argued that China’s purpose in provoking such confrontations is to deliberately stretch and weaken the security linkages that bind the United States to Southeast Asia. “By confronting America's friends with force”, he says, “China confronts America with the choice between deserting its friends and fighting China. Beijing is betting that, faced with this choice, America will back off and leave its allies and friends unsupported. This will weaken America's alliances and partnerships, undermine U.S. power in Asia, and enhance China's power.”

But Vietnam is not an ally of the United States, so this episode was a better demonstration of the problems of standing against China alone. However, in provoking this confrontation, Beijing has achieved the opposite of White’s expectations: pushing Hanoi closer to Washington. As David Elliott's recent book makes clear (and see my review here), Vietnam’s foreign-policy orientation has been generally pro-China ever since it stopped being pro-USSR. Over the past two decades, it was only when the “pro-China” voices were weakened by policy failures and Chinese antagonism—that liberalizers were able to reorientate Vietnam’s foreign policy.

The analyst Zachary Abuza has given us an enlightening account of how the balance of forces within the upper leadership of the Communist Party of Vietnam has changed as a result of the oil-rig standoff. “A June 2014 meeting of the Vietnam Communist Party's Central Committee unanimously resolved to condemn Chinese aggression and encroachment” he tells us. In late July, Politburo member Pham Quang Nghi made an intriguing visit to the United States at the invitation of the State Department.

In short, whatever China hoped to achieve with the deployment of HS-981—oil, territorial advantage or long-term strategic gain—didn’t work out. How can we explain such a foreign-policy failure? I think the episode shows how China’s South China Sea policy is more a reflection of internal priorities than a considered foreign policy. In short, the South China Sea has become a giant pork barrel for some of China’s provinces, state agencies and state-owned enterprises.

Two decades ago, John Garver argued that the Chinese navy’s push into the South China Sea represented “the interaction of national and bureaucratic interests”. They’re still interacting. Their navy’s getting bigger along with its budgets. Prestige, promotion and pecuniary rewards are following. The same is true of the new China Coast Guard—a year after the merging of several smaller maritime authorities into one. The Coast Guard needs to focus on something other than internal squabbling as it completes that merger and both it and the navy are looking for missions to demonstrate their usefulness and justify their funding.

And what’s true of the military is true of southern provinces. Hainan is China’s smallest province and relatively poor with an economy dominated by agriculture. In recent years it’s put great efforts into developing its fishing industries and become expert at harvesting state subsidies to equip new boats. Some excellent on-the-ground reporting by Reuters last month reminded us of the hundreds, perhaps thousands of fishing boats receiving between $300 and $500 per day to go fishing in disputed waters. While one captain noted that, “The authorities support fishing in the South China Sea to protect China's sovereignty” it might be just as accurate to say the authorities make use of the sovereignty claim in order to justify the support for fishing. Reuters discovered that eight trawlers being launched in the port of Dongfang on Hainan would each qualify for $322,500 in “renovation” grants.

Oil companies are also able to play the sovereignty card in support of their semi-commercial ventures in the South China Sea. In May 2012, when CNOOC launched the heavily-subsidised deep water rig at the centre of the Paracels standoff, HS-981, its chairman famously described it as, “mobile national territory and a strategic weapon”.

It seems strange, therefore, that CNOOC was not in charge of the Paracels expedition. Why was this? We're not privy to the corporate machinations but a few explanations suggest themselves. CNPC may have been willing to take risks that CNOOC wasn't—both technical and political. This was the first time that HS-981 had been used in deep water and the first time in disputed water. Perhaps CNPC was trying to steal a march on CNOOC by staking a claim in an unexplored area. Or perhaps CNPC’s senior management was trying to get itself out of deep political trouble. Spiralling corruption allegations against the company were becoming a national political scandal. CNPC’s management might have regarded a mission to fly the flag in disputed territory as a way of currying favour with the Politburo and saving their skins.

None of this is meant to deny that the Chinese participants in the oilrig standoff believe wholeheartedly in the validity of their country’s territorial claim in the South China Sea. The legend of China’s ‘indisputable sovereignty’ has been inculcated into generations of Chinese children. I have argued elsewhere that this belief depends upon early-twentieth century misreadings of Southeast Asian history by Chinese nationalists but I have no doubt that the Chinese leadership sincerely believes in its correctness.