Surprisingly, after Wednesday's Chinese stock market plunge and gloomy media coverage, the Chinese stock market ended the week ahead. By Friday, the benchmark Shanghai Composite index had gained 5.1 percent from the previous Friday's close.

The increase followed a series of extraordinary interventions by the government. In an effort to prop up prices, the government banned some people from selling shares, ordered other people to buy shares, and provided cash to help people buy stocks with borrowed money.

It's impossible to know if these interventions were responsible for this week's market reversal. But if they were, that's not a good thing.

Stock markets play an essential role in developed economies, directing resources to businesses where they'll be used most productively. But they can only serve this role if governments let them. And in the last week, the Chinese government has made it clear that the government's political goals will take a higher priority. The government's actions may have prevented a politically embarrassing stock market meltdown, but in the process, they've made the task of modernizing China's economy more difficult.

How the Chinese government rescued its stock market

Since the start of July, the Chinese government — and private parties acting with government encouragement — took a number of dramatic steps to reverse the stock market's decline:

The central bank has provided more cash to the China Securities Finance Corp, a state-run company that lends people money so they can buy stocks.

Initial public offerings were suspended, so that newly issued shares wouldn't compete for capital with those already on the market.

About half of the companies listed on China's two major exchanges suspended trading altogether.

Companies' major shareholders — those with more than 5 percent of a company's shares, as well as executives and board members — were banned from selling shares for six months.

China's securities regulator ordered companies to either buy their own shares or encourage their executives or employees to do the same.

The Chinese government can make the stock market go up if it really wants to

In the United States, the government doesn't have much control over stock prices. President Obama can't ban people from selling shares, nor could he order the Federal Reserve to finance loans so people can buy shares.

The specific measures the government takes are less important than how it communicates its goals

But the Chinese government doesn't face the same constraints. It has the power to print an unlimited amount of cash, so in the worst-case scenario it could buy as many shares as it took to reach a target price. And as the last week has shown, there are a number of less drastic — but still heavy-handed — strategies the government can employ to boost share prices.

Markets are heavily influenced by expectations, so the mere perception that the government is determined to boost share prices may be sufficient to cause a stock market rally. In this sense, the specific measures the government takes are less important than how it communicates its goals.

For example, the Financial Times reports that students at Tsinghua University, sometimes described as the MIT of China, will be instructed on Sunday to chant the slogan "revive the A shares, benefit the people." Obviously, chanting won't directly boost stock prices. But by holding this kind of demonstration, the government can show that it's serious about its commitment to higher stock prices.

Students at Tsinghua University will be instructed to chant the slogan "revive the A shares, benefit the people"

And once the public becomes convinced that the government plans to push stock prices up, they'll start buying stocks themselves in anticipation of the increases, creating a self-fulfilling prophesy.

The problem is that once the government commits to higher stock prices, its prestige becomes tied up with the stock market's performance. The people who bought stocks this week at the government's urging will feel all the more betrayed if prices crash again at some point in the future. That will make it even more difficult for the government to let stocks fall later if stocks become overvalued.

China really needs to give markets a bigger role in allocating capital

China needs a functioning stock market in order to improve the performance of the Chinese economy. The country's economy is still too dominated by habitually money-losing state-owned enterprises. To continue growing, China needs to develop a genuinely independent private sector — one in which success is determined by profits and losses, rather than political favor.

China needs a functioning stock market in order to improve the performance of the Chinese economy

Chinese President Xi Jinping recognizes this problem, and until recently he stressed his commitment to giving the market a greater role in economic decision-making. As long as markets were going up, this was easy. The real test was what happened when markets started falling. And this week Xi's government totally failed the test.

The problem here isn't just that inflated stock prices will let some unsuccessful companies raise capital that won't be put to good use, though that is a problem. The larger problem is that the last week's interventions have sent a clear signal that political influence is still of paramount importance in Chinese capital markets. That means the next generation of Chinese executives, entrepreneurs, and investors will spend less time trying to make their companies more productive and innovative and more time thinking about how to curry favor with the government in Beijing.