RAHM EMANUEL, who is poised to retire as Chicago’s mayor, recently bragged that on his watch the population of America’s third-largest city had grown. “It is up by about 30,000 in my tenure,” he said. That is a trifling increase for a city with 2.7m residents, but is at least a welcome sign of stability after decades of decline. In the decade to 2010 Chicago lost some 20,000 residents every year.

Untangling the demography of any big city is messy. This month America’s census bureau released population estimates for American metropolitan areas in 2018. They show that even if Chicago as a city has a stable population, its wider metropolitan area is suffering stagnation or decline. The region includes suburbs across 14 counties, sprawling far beyond the official city limits, containing roughly 9.5m residents. The census bureau says that for the fourth year in a row the wider Chicago-area lost population last year. New York and Los Angeles also saw slight declines.

What explains this fall? Critics of Illinois’s relatively high taxes point out that the state’s overall population is also falling; they also blame government dysfunction, corruption and high cost of living. On Twitter #IllinoisExodus has become a popular hashtag for residents debating the census figures and fuming about taxes. A widespread myth in Chicago suggests the population figures are shifting because many wealthy residents abandon the metropolitan area, fleeing to lower tax—and sunnier—alternatives in the South, especially Florida.

The reality is strikingly different, argues Daniel Kay Hertz of the Centre for Budget and Tax Accountability, in Chicago. He points out that the most popular destinations for wealthy residents (defined as belonging to households earning at least $100,000 a year) who leave Illinois include the New York’s metro area, Los Angeles, San Francisco, the Twin Cities in Minneapolis, as well as Houston. That list, he argues, suggests residents are probably moving to take up jobs, or for family reasons, but they are not obviously hunting for low-tax destinations.

It is also the case that Chicago (the city) is mostly losing poorer residents who are overwhelmingly African-American, while it gains or maintains its population of higher-skilled people, whites and Asians especially. More prosperous residents appear most likely to remain in Chicago, while less-educated and poorer ones tend to move out. As Rob Paral, a Chicago-based demographer, points out: “without the decline in African-Americans, the city population would be stable or growing”.

Why black Americans continue to leave in droves is only vaguely understood. The most obvious reasons include their reasonable worries about high levels of violence, poor schools, run-down housing and a lack of amenities—such as supermarkets—in the fast-depopulating south side of Chicago. Some are also taking part in the “reverse great migration”, returning to live with extended families who stayed on in the South during a big shift of African-Americans to northern cities a century ago.

Pete Saunders, an urban planner who has long blogged on demographic trends in mid-Western cities, argues that Chicago suffers – and fails to keep its black residents - because it remains deeply segregated by race and wealth. For professional and middle class African-Americans, he says mobility within the city remains too difficult. And Chicago fails, especially, to get African-Americans into colleges to learn skills needed for high-paying and service jobs that are now widely available in the city. “Chicago’s economy really restructured over the last 25 years, but in large part the African-American population has been passed by,” he says. He calls that economic change the “trend that undergirds everything”.

The exodus of black Americans has not yet bottomed out and may not do so for years to come. But even counting this steady flight of from Chicago, Illinois is not exceptional for the outflow of its people. Mr Hertz says that Illinois is akin to New Jersey or Arizona, for example. What really matters, he says, is how the state no longer draws in enough newcomers to compensate for the outflow: Illinois is exceptional in failing to bring in enough new migrants.

Traditionally Chicago was one of a handful of gateways for immigrants to America, and thus to the rest of Illinois. Among legal, documented migrants, says Mr Paral, Chicago was one of a few big cities that attracted skilled workers. Manufacturing plants that long produced non-durable goods were also a magnet for low-skilled, undocumented migrants, overwhelmingly from Mexico. He calls Chicago (the city) a “conveyor belt” that brought in migrants who gradually moved out to settle in suburbs and the wider metro area.

That belt no longer works as it once did. Overall numbers of legal migrants to America have not fallen in the past decade or so, but high-skilled newcomers to Chicago prefer to head to big cities on the coasts, or to booming small ones in states such as Nevada or South Carolina. More significantly, undocumented migrants have come in smaller numbers to America in the past decade, with Chicago losing out. Mr Hertz adds that among domestic, American migrants, Chicago traditionally draws from the rest of the Midwest, not the rest of the country. It may now be that aging Midwesterners are becoming less willing to move to Chicago, too.

Meanwhile another trend is reshaping where residents of the wider Chicago area live. A different conveyor belt once carried wealthy city residents into the suburbs, but it increasingly works the other way around. Mr Paral says rich residents increasingly shun suburbs and prefer to live in the booming downtown or other central parts of the city, especially on its northern side. This process is happening just as suburbs see poorer and racially diverse residents moving in. The result has been falling house prices in the “collar counties” around Chicago, for at least a decade, even as demand for property in expensive parts of the city booms.

How much does a change in population matter? Mayors know the answer to that. Mr Emanuel is about to be replaced by Lori Lightfoot. She knows that Chicago—just like the state of Illinois—faces big financial difficulties in the coming years. As mayor she must find a way for the city to fund billions of dollars of pension debt and at the same time get to grip with big gaps in public finances. Those tasks will be painfully difficult. Taking them on if the population is falling will be more arduous yet.