In the past two weeks, the Chinese government has granted U.S. President Donald Trump a total of 38 valuable trademarks. They come as tensions between China and the United States have cooled somewhat, leading to suggestions that the award is a poorly concealed quid pro quo designed to reward a president with considerable personal business interests. On Tuesday, Sen. Ben Cardin went so far as to accuse China of “trying to curry favor with the president of the United States.”

That sounds plausible. But Chinese officials have other reasons for ensuring that Trump’s trademarks are protected. And currying favor probably isn’t atop the list.

In most countries, obtaining a trademark isn’t frontpage news, even for a president. But China is unique in that it employs a “first to file” system requiring no evidence of ownership or prior use. For example, Xintong Tiandi Technology Ltd., a leather goods firm, legally markets iPhone wallets in China because it registered “iPhone” for use on leather products in 2007.

Such “trademark squatting” contributes to an atmosphere of general chaos when it comes to intellectual property in China. If a nobody can own a valuable foreign trademark, then effectively no one owns it, and oversight will be lax. Late last year, 258 trademark applications were filed using various permutations of “Ivanka Trump,” and knockoff Ivanka stuff is everywhere. Enforcement for anyone, from Apple Inc. to Ivanka, is close to nonexistent.

But there are important exceptions. In 2004, a Beijing entrepreneur attempted to trademark President George W. Bush’s name (Bu Shi, in China) in connection with a line of disposable diapers. At the time, the People’s Daily, the Communist Party’s official newspaper, reported that it was unlikely to be approved because “it may bring about bad social impact if a leader’s name is registered as a trademark.”

Bu Shi Diapers were unlikely to shake Chinese society. From the perspective of the Communist Party, though, a surge of Bush-branded commercial goods — even uncomplimentary ones — looked like a looming threat. After all, Chinese leaders never appear on products, so the prospect of supermarkets full of items bearing the likeness of a democratically elected foreign leader was cause for alarm.

Similarly, in 2009, authorities cracked down on “Obamao” T-shirts, which depicted President Barack Obama in a Mao cap and collar. At the time, Obama was wildly popular in China, and the government clearly didn’t relish young Chinese wearing the shirts during his official visit to Shanghai and Beijing. Trump may not be popular, but the logic is the same: Why give a rival visibility?

If the goal is to keep Trump-branded products off Chinese shelves, granting Trump a bunch of trademarks would seem like an odd way of doing it. But the government’s goal probably isn’t to give the Trump organization free rein to market in China.

Rather, it most likely wants to send a message to trademark squatters (and those who aspire to join them) that their applications — and hence products — won’t be tolerated. The government’s recent crackdown on counterfeit Disney merchandise in advance of the opening of the Shanghai Disney Resort is proof that it can enforce licensed trademarks when it wants to.

After the Trump controversy came to light, China’s Foreign Ministry spokesman, Geng Shuang, said that all trademark applications are handled “in accordance with the law and regulation.”

China also knows that Trump’s recent trademark applications (including one for escort businesses) likely aren’t intended to precede new products. Rather, as Trump’s lawyer explained to The Washington Post, they’re defensive in nature, and designed to keep someone else from trademarking, and launching, Trump Escorts. That may sound convoluted, but it’s actually a common strategy for foreign companies hoping to protect their brands in China.

Moreover, China’s interest in protecting intellectual property is at least as strong as Trump’s in this case. In the coming months, the Trump administration is likely to roll out aggressive new policies in opposition to China’s trade practices, including its lax intellectual property enforcement. The last thing China wants is fake but licensed Trump products in Chinese stores making Trump’s case for him.

For now, at least, giving Trump his trademarks probably won’t put money into the president’s pocket. But it’s a crucial step for Chinese officials hoping to manage their relationship with an unpredictable new marketer in chief.

Adam Minter is a Bloomberg View columnist and the author of “Junkyard Planet: Travels in the Billion-Dollar Trash Trade.”