The shrinking power of unions and globalization have often been blamed for eroding the living standards for millions of Americans, but they might not have caused all that much harm after all.

The bigger culprits?

Boom-and-bust cycles in the economy and a shift in investment toward high-tech assets such as software and robots, according to a new study by global research firm McKinsey Global Institute.

If all the income generated by the United States each year is viewed as a pie, the portion going to workers has been shrinking for decades. From a high of 65.4% of GDP shortly after World War II to a low of 56.7% at the end of 2016.

The decline has been especially sharp since the late 1990s — and it comes at great cost to those who labor for a living. The average American worker would earn $3,000 more today if labor’s share of national income remained the same as it was in 1998, the study calculated.

“ The average American worker would earn $3,000 more today if labor’s share of national income remained the same as it was in 1998, the study calculated. ”

It’s not just happening in the United States, either.

Supposedly more egalitarian Europe has experienced the same phenomenon. The portion of national income going to workers in Germany and France, for example, fell to a half-century low right before the global financial crisis in 2008. The same trend has taken place in developing countries as well, though at a slower pace.

Read: ‘Whiff of U.S. recession’? It’s in the air again, but strong labor market the antidote

In the popular press, the blame has mostly fallen on globalization. Companies outsourced manufacturing to low-wage countries such as China so they could keep more of the profits, the argument goes, depriving American workers of jobs or forcing them to accept lower wages to keep companies from leaving.

The McKinsey study found that globalization and the decline of unions played a role, but only a small one. The firm estimates they account for no more than one-tenth of the decline in labor’s share of overall U.S. income.

How come?

Most industries in the modern U.S. economy — services such as retail, banking, health care and entertainment — are not heavily exposed to competition from low-wage countries. A person who needs financial advice or medical help is not going to hire a Chinese broker or see a doctor in Brazil.

A few important industries were hard hit, particularly auto manufacturing, McKinsey acknowledged. A lot of production was moved to nonunion plants in the southern U.S. or to Mexico, for instance.

By far the biggest reason more income is going to capital — businesses, investors, land owners — is a sharp boom-and-bust pattern not just in the U.S. economy as a whole, but within certain industries such as energy, mining and housing. That’s accounted for one-third of the decline in labor’s share of income since 1999.

The economic rise of China in the early 2000s, for instance, contributed to large increases in the global prices of many key commodities such as oil and metals. Producers kept most of the extra profit for themselves instead of sharing them with workers.

Another big factor in labor’s declining share of income is a shift away from traditional investments in machinery and buildings toward high-tech staples such as software, data, processes and other intangible assets. McKinsey attributes about one-fourth of the decline in labor’s share of income to what it calls “rising and faster depreciation.”

Put another way, these assets wear out faster or have a shorter life span than traditional investments, meaning more capital is used up in the production process. The result is less net income to go around for both labor and business.

What’s also generated more income for capital at the expense of labor is the rise of “superstar” firms and greater substitution of technology for people.

Apple AAPL, +1.02% would be a textbook example of a superstar firm. Alphabet’s GOOG, +0.92% Google and Microsoft MSFT, +1.29% would be others. These companies generate huge profits by developing stranglehoods on certain markets due to innovation, strong patent protection or a lack of competition.

What’s more, the groundbreaking technologies these companies produce have made it cheaper and more efficient for companies to deploy robots and automation instead of workers.

“If labor plays less of a role in production, for example through lower employment, its share of income can decline,” McKinsey noted.

There is a silver lining, though. The continued adoption of improved technologies is more likely to be positive for workers instead of negative by allowing them to be more productive on the job. That will help lead to higher wage gains in the future, McKinsey suggested.

“Policy makers may want to focus their attention on driving productivity growth to help address wage stagnation,” the study concluded.

What else can government do to help? Ensure a competitive playing field that limits the influence of superstar firms, for one thing, McKinsey said, and aid or retrain people when “changes in economic structure take place too rapidly for workers to adapt.”