Last month the Census Bureau confirmed a confounding dynamic taking hold across the American landscape: Superstar cities, the nation’s economic powerhouses, hotbeds of opportunity at the cutting edge of technological progress, are losing people to other parts of the country.

Net migration in the largest counties CHANGE FROM 2017 TO 2018 +3 % +2 Clark County, Nev. Net migration as a share of population Maricopa County, Ariz. +1 MORE PEOPLE ENTERING COUNTY 0 King County, Wash. MORE PEOPLE LEAVING COUNTY –1 N.Y. County, N.Y. Los Angeles County, Calif. Santa Clara County, Calif. Cook County, Ill. –2 Queens County, N.Y. Bronx County, N.Y. –3 1 2 3 4 5 6 7 8 9 10 County population in 2017, in millions Net migration in the largest counties CHANGE FROM 2017 TO 2018 +3 % Clark County, Nev. +2 Maricopa County, Ariz. Net migration as a share of population +1 MORE PEOPLE ENTERING COUNTY 0 King County, Wash. MORE PEOPLE LEAVING COUNTY –1 L.A. County, Calif. N.Y. County, N.Y. Santa Clara County, Calif. –2 Bronx County, N.Y. –3 1 5 10 County population in 2017, in millions Source: Census Bureau

For the first time in at least a decade, 4,868 more people left King County, Wash. — Amazon’s home — than arrived from elsewhere in the country.

Santa Clara County, Calif., home to most of Silicon Valley, lost 24,645 people to domestic migration, its ninth consecutive annual loss.

The trend is becoming widespread. Eight of the 10 largest metropolitan areas in the country, including those around New York, San Francisco, Los Angeles and Miami, lost people to other places in 2018. That was up from seven in 2016, five in 2013 and four in 2010. Migration out of the New York area has gotten so intense that its total population shrank in 2018 for the second year in a row.

As the chart above shows, 30 of the 44 largest counties, with populations above one million, recorded more domestic outflows than inflows of people in 2018.

This growing flow of people out of the hotbeds of innovation and economic activity underscores how lopsided the distribution of opportunity has become.

Places like Cupertino and Mountain View in Santa Clara County may still offer the best, most highly paid opportunities for the highly educated — lawyers and programmers seeking jobs at Apple or Google. The median family in that county makes $122,700 a year. In King County it is $105,512, way above the national median of $76,000.

The problem is that workers without a four-year college degree don’t earn anywhere near that much.

Consider janitors. In 1960, a janitor in the Deep South could more than double his income by moving to Santa Clara County, even after accounting for higher housing costs. Since then, janitors’ earnings have grown much more slowly in Silicon Valley and King County than in the Deep South. And this is upending the distribution of prosperity across the country.

How does a move to Silicon Valley affect a worker’s pay? FOR A JANITOR EARNINGS AFTER HOUSING COSTS* IN 1960 IN 2017 Deep South $14,105 $19,362 Moving from the Deep South to Santa Clara County, Calif., would have this effect on the earnings of a janitor’s household, after paying for housing costs. Santa Clara $29,202 $14,000 +$15,097 –$5,362 +107% –28% CHANGE FOR A LAWYER EARNINGS AFTER HOUSING COSTS* IN 1960 IN 2017 Deep South $85,547 $119,872 Moving from the Deep South to Santa Clara County, Calif., would have this effect on the earnings of a lawyer’s household, after paying for housing costs. Santa Clara $84,621 $172,047 –$926 +$52,175 –1% +44% CHANGE How does a move to Silicon Valley affect a worker’s pay? FOR A JANITOR Moving from the Deep South to Santa Clara County, Calif., would have this effect on the earnings of a janitor’s household, after paying for housing costs. EARNINGS AFTER HOUSING COSTS* IN 1960 IN 2017 Deep South $14,105 $19,362 Santa Clara $29,202 $14,000 +$15,097 –$5,362 +107% –28% CHANGE FOR A LAWYER Moving from the Deep South to Santa Clara County, Calif., would have this effect on the earnings of a lawyer’s household, after paying for housing costs. EARNINGS AFTER HOUSING COSTS* IN 1960 IN 2017 Deep South $85,547 $119,872 Santa Clara $84,621 $172,047 –$926 +$52,175 –1% +44% CHANGE *In 2017 dollars. Note: Deep South means the weighted average of Alabama, Arkansas, Georgia, South Carolina and Mississippi. | Source: Peter Ganong and Daniel Shoag analysis of census and American Community Survey data

Today it makes a lot of sense for a lawyer to move to Silicon Valley from the South. The additional pay will more than compensate for the higher cost of housing. But a janitor moving from, say, somewhere in Alabama to Cupertino could see her household income, after paying rent, fall by more than half.

The divergence of economic opportunity for workers on either side of college is not a new phenomenon. But we are only beginning to understand how it has reconfigured the rationale for migration: Moving to opportunity is not what it once was.

[Read more: The trick to getting better-paying jobs may be simply finding them. They are not always in the most obvious places.]

Forty or 50 years ago, someone with no more than a high school diploma had much better job opportunities in a big city than in a small town. Not only did those at the bottom of the wage scale — janitors, cashiers at 7-Eleven — make more money in dense urban centers, but these places also offered data entry, bookkeeping and other jobs that paid middle-class wages while requiring little or no college experience.

But as my colleagues Emily Badger and Quoctrung Bui noted recently in an article citing the work of the M.I.T. economist David Autor, big cities have lost their luster for workers without four-year college degrees. They will make no more in New York or San Francisco than they would in, say, small-town Alabama.

The clerical jobs that cities used to offer are largely gone, replaced by computer software or outsourced to other parts of the world. Moreover, the wage bump that big cities used to offer janitors and cashiers has mostly disappeared. Those who used to hold middle-income positions have dropped down the wage scale, competing for jobs at the bottom.

And even as big-city wages flatlined for workers without the requisite college degree, big-city housing prices soared ahead.

Housing Price Index 1975 = 100 2,000 Santa Clara County, Calif. 1,500 1,000 King County, Wash. 500 U.S. AVERAGE 0 ’75 ’80 ’85 ’90 ’95 ’00 ’05 ’10 ’15 ’17 Housing Price Index 1975 = 100 2,000 Santa Clara County, Calif. 1,500 1,000 King County, Wash. 500 U.S. AVERAGE 0 ’80 ’90 ’00 ’10 ’17 Source: Federal Housing Finance Authority

Research by Peter Ganong from the University of Chicago and Daniel Shoag of Harvard suggests that housing costs are a principal driver of the change in migration decisions: As the highly educated have flocked to superstar cities, they have pushed housing prices way beyond the reach of people earning less.

Rising rents affect everybody, of course. But housing sucks up a bigger share of the income of the poor. In 1960, housing absorbed 17 percent of a janitor’s household earnings in King County, compared with 9 percent of a lawyer’s, according to data from Mr. Ganong. By 2017, lawyers’ households had to pay almost 15 percent of their incomes. Janitors’ households had to pay 38 percent.

Migration to rich and poor places In 1940, both highly educated and less educated workers moved from poorer areas to richer ones, where wages were higher. 1940 LESS-EDUCATED HIGHLY EDUCATED +3 % +3 % Net migration as a share of population +2 +2 People moving to richer regions MORE PEOPLE ENTERING +1 +1 0 0 –1 –1 MORE PEOPLE LEAVING –2 –2 People leaving poorer regions –3 –3 $5 $20 $40 $5 $20 $40 Average household earnings (in thousands) Average household earnings (in thousands) Domestic migration declined sharply by 2016. But while the highly educated are still more likely to move to the richest cities, the less educated have stopped. They see no opportunities there. 2016 HIGHLY EDUCATED LESS-EDUCATED +3 % +3 % Net migration as a share of population +2 +2 MORE PEOPLE ENTERING +1 +1 0 0 –1 –1 MORE PEOPLE LEAVING –2 –2 –3 –3 $50 $100 $150 $50 $100 $150 Average household earnings (in thousands) Average household earnings (in thousands) Migration to rich and poor places In 1940, both highly educated and less-educated workers moved from poorer areas to richer ones, where wages were higher. 1940 LESS-EDUCATED +3 % Net migration as a share of population People moving to richer regions +2 MORE PEOPLE ENTERING +1 0 –1 MORE PEOPLE LEAVING People leaving poorer regions –2 –3 $5 $20 $40 Average household earnings (in thousands) HIGHLY EDUCATED +3 % Net migration as a share of population +2 MORE PEOPLE ENTERING +1 0 –1 MORE PEOPLE LEAVING –2 –3 $5 $20 $40 Average household earnings (in thousands) Domestic migration declined sharply by 2016. But while the highly educated are still more likely to move to the richest cities, the less-educated have stopped. They see no opportunities there. 2016 LESS-EDUCATED +3 % Net migration as a share of population +2 MORE PEOPLE ENTERING +1 0 –1 MORE PEOPLE LEAVING –2 –3 $50 $100 $150 Average household earnings (in thousands) HIGHLY EDUCATED +3 % Net migration as a share of population +2 MORE PEOPLE ENTERING +1 0 –1 MORE PEOPLE LEAVING –2 –3 $50 $100 $150 Average household earnings (in thousands) Note: Each dot comprises a group of places that contain roughly 5 percent of the working households in the population. The net migration is measured as the number of working households arriving from other parts of the country minus the number that are leaving, as a share of all working households in the area. There are some definition changes between the two periods. In 1940, a highly educated worker was one who had finished high school. In 2016 it is one who has at least a bachelor's degree. The census' measure of migration also changed between the two periods. In 1940, it asked people where they were five years earlier. In 2016, the American Community Survey asked where people were the year before. | Source: Peter Ganong and Daniel Shoag analysis of data from the census and the American Community Survey

Given the changing geography of economic opportunity, the new pattern of migration starts making sense.

In the middle of the 20th century, rich urban clusters drew people from across the educational spectrum. Moving to the big city in search of a good job was as sound a decision for a worker who hadn’t completed high school as for someone with a college degree.

That attraction has faded even for the most-educated workers. Changes in the way the Census Bureau records domestic moves — in 1940 it asked people where they were five years ago; in 2016 it asked where they were the year before — reduces reported migration rates. Still, migration has subsided significantly over the last few decades. In 2016, more people with a bachelor’s degree or more left the nation’s richest metropolitan areas than arrived seeking opportunities there. Rising housing costs seem to deter them, too. For workers who haven’t cleared the college threshold, this is doubly true. For them, New York or Los Angeles or Seattle or San Francisco no longer makes sense.

It is not obvious how to turn big cities back into magnets of opportunity for the working class. Many of the jobs that offered a leg up to those without a college background no longer exist and won’t come back. But there are policies that could make a difference. Relaxing zoning regulations to make it easier to build could slow rising rents, ensuring that the housing supply keeps up with demand.

And yet the prospects do not look good. California lawmakers last week shelved Senate Bill 50, which would have forced cities to allow denser housing near public transit and removed density limits in wealthier areas close to job centers and good schools. The bill faced stiff opposition from many municipal governments and residents enamored with low-density living — not to mention rising property values.