Donald Trump’s “phase one” agreement with China, expected to be signed this week, is intended partly to slow China’s move into new technologies like electric cars by protecting the intellectual property of American corporations.

Which lends a certain irony to Tesla’s Model 3 electric sedans now coming off assembly lines at the firm’s new multibillion-dollar plant in Shanghai.

The Model 3 marks a huge milestone for Elon Musk’s company as it rapidly expands in the world’s largest electric-vehicle market. But it’s not a milestone for America.

The people who are learning how to make electric cars ever more efficiently in Tesla’s Shanghai factory are Chinese.

The Chinese are intent on learning as much as they can from Tesla and other leading global corporations. And the corporations don’t care as long as their investments in China pay off.

Trump is demanding that China provide stronger patent and copyright protections. But the Chinese, who are gaining valuable experience with firms such as Tesla, will take what they learn and apply it elsewhere regardless.

To the extent that those better protections increase the profits of American firms in China, American firms will invest even more in China.

Trump doesn’t understand a basic reality of today’s global economy: the profitability and competitiveness of American corporations aren’t the same as the well-being and competitiveness of Americans. American corporations have no particular obligation to the United States. They’re obligated to their shareholders.

About 30 percent of the shareholders of large American corporations aren’t even American. As global money sloshes ever more quickly across borders, that percentage is growing.

The 500 largest corporations headquartered in the United States are steadily becoming less American. Some 40 percent of their employees live and work outside the United States. They sell and buy components and services all over world. They do research wherever they find talented engineers and scientists.

China’s share of global research and development already tops America’s. One big reason, according to the National Science Foundation, is that American firms nearly doubled their research and development investments in Asia over the last decade.

They did so because China is a huge and growing market, with an increasing number of talented researchers and well-educated workers.

In 2017, General Electric announced it was increasing its investments in advanced manufacturing and robotics in China, which it termed “an important and critical market for GE.”

Google has opened an artificial intelligence lab in Beijing, headed by Google’s chief scientist for AI and machine learning.

Even when it comes to technologies linked to national security, American firms have no particular allegiance to America. They’ll make and sell anything, anywhere, unless U.S. law stops them.

Last July, the U.S. Senate held hearings on Facebook’s planned cryptocurrency, “Libra.” Facebook executives insisted it be allowed to create the currency or “some other country will.”

But Facebook’s motive for developing Libra has nothing to do with stopping China from creating its own cryptocurrency. Facebook wants to be free to make as much money as it can, wherever. After all, Facebook has spent much of the last decade trying to curry favor with the Chinese in hopes of opening China to Facebook.

Not even the worldwide association Facebook established for Libra is based in the United States. It’s in Switzerland, home of famously lax banking laws.

The reality is that leading global corporations such as Tesla, GE, Google and Facebook will create good, high-wage jobs in the United States (or in Britain, Australia or anywhere else you may be reading this) only if their inhabitants are clever and productive enough to make it profitable for them to do so.

This means that the real competitiveness of the United States depends on the creativity and productivity of Americans. That in turn depends on Americans’ education (including the basic research that’s done in national labs and universities), health and the infrastructure connecting them to one another.

But the American workforce is hobbled by deteriorating schools, unaffordable college tuitions, decaying infrastructure, soaring health-care costs and diminishing basic research.

All of which is putting most Americans on a path toward second-rate jobs in the global economy.

Big American-based corporations don’t see it as their responsibility to fix this. They certainly don’t want to pay for it. To the contrary, they’ve lobbied for and received tax cut after tax cut.

Yet they have an iron grip on American politics through their campaign donations, lobbying and public-relations campaigns.

Trump isn’t helping. His economic nationalism continues to champion American corporations, not American workers.

This, not China, is the real source of America’s competitive woes.

Robert Reich’s latest book is “The Common Good,” and his newest documentary is “Saving Capitalism.”