Photograph: Vjeran Pavic

For most of the twentieth century, Americans took a certain social geography for granted: the well-off lived in the suburbs, encircling poor city centers. But in other parts of the world, notably in Europe, the pattern has typically been reversed. Think of Paris banlieues, where the poor live in public housing and commute long distances to jobs in the urban core.

When I wrote a book on the urban experience forty years ago, most Americans viewed that experience with trepidation. The image of city life as bleak, dilapidated, and dangerous soon became entrenched. Moving to the suburbs, which the American middle class had been doing for generations, turned into “flight.”

But those scary years were unusual. Historically, cities have been wealthier, safer, and more welcoming than their surroundings—even as they were, at the same time, sites of cultural deviation and political dissent. Before the 1970s, big American cities still had charm. Families went to the movies to see On the Town (1949) or Breakfast at Tiffany’s (1961); crooners sang Lorenzo Hart’s lyrics describing Manhattan as “an isle of joy.” By the 1970s and ’80s, however, New York had come to be associated with dark movies such as Taxi Driver (1976) and Death Wish (1974). Grandmaster Flash’s 1982 rap hit “The Message” declaimed, “It’s like a jungle sometimes / It makes me wonder how I keep from goin’ under.”

Cities have become a sensible choice for the well-off, and suburbs a necessity for the poor.

Now the wheel has turned again: filmmakers are having trouble finding stereotypically grimy alleys in Manhattan. Today’s political fights are not about stemming urban decay but about stemming urban upscaling. What happened?

In the nineteenth century, first wealthy and then middle-class Americans, commuting by horse-car lines, trains, and then electrified streetcars, moved out from the city centers. The emergence of affordable automobiles in the early twentieth century enabled yet more families to follow. Greenery and spacious houses drew well-to-do Americans, while city turmoil and noise—and especially anxiety about foreign and dark-skinned newcomers—thrust them out.

The new pattern, roughly one of concentric circles, entailed a central business district surrounded by a mix of industrial sites and poor housing, then a band of working-class districts, all surrounded by middle-class and elite suburbs. Post–World War II development accentuated this arrangement. In the suburbs, single-family housing boomed, shopping malls opened, and white-collar employers arrived. In city centers, aging housing, infrastructure, and factories accelerated depopulation. Several federal policies subsidized and encouraged urban sprawl, construction of single-family homes, and whites-only suburbs. As more southern blacks moved into northern cities, racial anxieties further spurred white flight. The violent crime wave that began in the 1960s seemed to cement the pattern: jobless black ghettoes in the center, affluent white suburbs and gleaming office parks on the outside, and anxious working-class whites in between.

But today we hear a different story. The media propound on millennials occupying—and latté-ifying—gritty inner-city neighborhoods. We are accustomed to pictures of refurbished lofts in New York or glammed-up gingerbread houses in San Francisco. The national trends are somewhat more obscure, though, and for a number of reasons. City–suburb distinctions are muddied because they reflect arbitrary political boundaries. Hoboken is closer to Wall Street than Queens is, but, administratively, Queens is considered part of the city. Moreover, the city boom is happening in some regions (especially the Pacific Coast) more than in others (the Heartland), and the Great Recession sent a slew of young people back home.

Nonetheless, data show that the downtowns of many major cities started attracting middle-class people, especially recent college graduates, a couple of decades ago, as their less-educated fellows stayed in or headed to the suburbs. Prices started to reflect the growing demand for city living. Today, houses near downtown are often luxury goods. Meanwhile, many of the city poor have moved out, some to the suburbs. Since the early 2000s, more poor Americans live in suburbs than in cities, a mounting trend.

An analysis of U.S. Census data for Atlanta, Charlotte, Denver, and Houston shows that between 1990 and 2012 the percentages of residents living in the very center of the city who had bachelor’s degrees roughly doubled, while the percentage who were poor dropped. Ten to fifteen miles out, the presence of poor residents increased substantially. Low-wage downtown workers who were once close to their jobs have to drive much longer distances from their new suburban neighborhoods. Restaurateurs in San Francisco complain that even well-paying service jobs go unfilled. Just as city centers are starting to become safer, nicer places, the poor can no longer afford them.

Corporate offices, too, have been moving back—or moving for the first time—into city centers. General Electric recently announced that it is moving its headquarters from suburban Connecticut to Boston’s Seaport District. Well known are the Silicon Valley tech firms expanding their presence in San Francisco—to the consternation of many locals.

Nothing marks American neighborhoods more than race. Latino and Asian immigration has made metropolitan areas more complex socially, but the inversion of urban patterns can be read clearly in black and white. After decades of sharp decline, the white population of major cities stabilized and then started rising. In the last few years, it has grown while the size of the black population has held steady. Major black growth has instead occurred in the suburbs, where the white population is stagnant. Ferguson, Missouri, dramatizes the suburbanization of poverty and race. Rutgers scholar Paul Jargowsky points out that as “recently as 1990, Ferguson was 75 percent white, but by 2010 it was about two-thirds black. The poverty rate shot up from 7 percent to 22 percent over that period.”

While the ongoing inversion of America’s urban social geography is apparent, its explanation is not. Several factors probably contributed. One is demographic. Young, childless adults and affluent empty-nesters—the sorts of people who lean toward city life—have become proportionally more numerous. But the process of city revival has been long and deeply rooted. Demographics can’t be the whole story.

Another factor is the shifting economics of land use, which for so long encouraged middle-class sprawl. Inner city property values fell as infrastructure decayed. It finally dropped enough to warrant investor risk-taking. The result has been new city malls, new office buildings, and new or restored housing. Meanwhile the suburban housing of the 1950s and ’60s aged, becoming both less attractive to the affluent and more affordable to the non-affluent. For young middle-class couples, the idea of moving even further out to yet greener pastures became less practical as extended commutes strained family life. Cities became a more sensible choice for the well-off, and aging suburbs more of a necessity for the poor.

The sudden, and still poorly understood, drop in violent crime starting about twenty-five years ago further encouraged city revival. Americans of 1976 would be astonished to see New Yorkers’ evening strolls in Central Park in 2016. The influx of immigrants in the 1980s and ’90s seems to have helped revitalize city commerce and reduce crime.

Another factor may be a shift in Americans’ values. City-bound corporate leaders often say they go where the workers they seek want to live and play. The “smart growth” planning movement, which emphasizes transportation hubs and walkable neighborhoods, both reflects and stimulates a pro-city ideology. In a 2008 poll, respondents between eighteen and thirty-four years of age were about twice as likely to prefer city living as were older respondents. Does this reflect a growing taste for “bright lights, big city,” or just youthful fancy?

Reports suggest that, for the first time in a long time, white births are increasing in Manhattan and Center City, Philadelphia. We will know more about how long this pattern is likely to last when today’s urban residents have children of school-going age. For now, singers can return to the Vernon Duke lyrics, “It’s autumn in New York / It’s good to live it again.”