A few weeks ago, on a walk-the-streets visit to New York, I found myself in the middle of a clump of foreigners getting a grand introduction to Harlem. As we gazed at the newly pricey brownstones and lively commercial boulevards, an agitated local resident slipped in to give the visitors a lesson in reality. “Don’t be fooled,” the man warned. “This place is still full of guns and drugs. This ain’t heaven up here.”

The fact that he was telling the truth was less interesting to me than that he felt obligated to make his case. But he did have to.

On a sunny Saturday at the start of 2014, Harlem looked so improbably good that it was easy for a visitor to place its troubles in a remote intellectual compartment. If you were visiting from Denmark, you might be justified in puzzling over why Harlem had a dangerous reputation.

The following day, scanning over some local headlines from the backseat of a cab, I came across one that brought back echoes of the not-too-distant past: “Mugging reported in Central Park.” I was fairly sure that 20 years ago, that wouldn’t have been news. Not because muggings didn’t take place in the park, but because they took place all the time. One more mugging wouldn’t have been enough to touch the antennae of tabloid journalism.

Both of these tiny incidents served to convince me that Mayor Bill de Blasio has an even tougher job ahead of him than the media have proclaimed. Having won the election to succeed Michael Bloomberg by pointing to a tale of two unequal cities, one affluent and one quite desperate, he now must establish a sense of urgency among comfortable New Yorkers for whom the desperation is scarcely visible.

Twenty years ago, in pointing to the suffering neighborhoods he had arrived to help, de Blasio would have had a much greater array of troubled places across the five boroughs to choose from. In Brooklyn, he could have pointed to Bushwick, the old industrial enclave brought low by the departure of big brewing companies, struggling to survive in a degraded world of gang violence, Mafia corruption and overall physical disinvestment. He could have pointed to Flushing or Astoria in Queens as bastions of Archie Bunker-style last-gap urbanism, with struggling white ethnic homeowners nursing bitter resentment against the comfortable liberals across the river in Manhattan. Even more clearly, he could have seized upon the South Bronx, a region of the city whose shocking decline had gone unreversed despite decades of state, local and federal investment.

All three of those neighborhoods still house more than their share of the truly needy New Yorkers who have gained nothing from the affluence that has come to characterize Bloomberg’s city. But Bushwick is now part of Brooklyn’s gentrification, a magnet for urbanites who can no longer afford to live in nearby Williamsburg.

Flushing is home to the region’s most expansive and hard-striving Chinatown, jammed to overflowing with locals and tourists alike on any pleasant Saturday or Sunday morning. And the South Bronx, deeply impoverished as it remains, is now the center for New York’s boldest experiments in multifamily housing, praised by social activists as well as mainstream architectural critics.

None of this is to suggest that de Blasio won’t find plenty of disheartened and dispossessed New Yorkers to form the basis of an insurgent constituency. It is merely to say that he may have to look harder for them than he would have in the past. But he will be the mayor of the neighborhoods, that is certain. For one thing, it is what he wants to be. For another, recent history leaves him very little choice.

If you will allow me a little room to overgeneralize, I would argue that there are “downtown” mayors and there are “neighborhood” mayors, and some who try to be both. Downtown mayors devote major efforts to reinforcing or rebuilding the commercial infrastructure on the theory that the benefits of a strong commercial core will naturally radiate out to neighborhoods. Usually this means spending money on downtown shopping malls and public transportation, museums and convention centers, and encouraging the construction of downtown residential projects aimed at attracting more affluent residents.

Neighborhood mayors win election by catering to the middle-class and working-class communities on the periphery who perceive themselves as having been left out by an administration with an emphasis on the center; pay attention to the periphery, their thinking goes, and downtown will take care of itself. A neighborhood mayor makes extensive commitments to affordable housing, whatever that may happen to mean in his place and time; he also places a high emphasis on making public appearances in rarely visited corners of the metropolis, and establishing formal relationships with community groups whose leaders are given conspicuous access to top members of the city administration.

The distinction between downtown mayors and neighborhood mayors is often as much one of rhetoric and media labeling as it is of actual policy choices. Bloomberg was widely viewed as the mayor of Manhattan and affluent inner Brooklyn, even though his administration actually built more than 150,000 units of subsidized housing during its 12 years in office, most of them in outer borough locations Bloomberg was repeatedly accused of ignoring. De Blasio ran much of his campaign against Wall Street, but it will be impossible for him to ignore the fact that Manhattan’s financial industry provides the city with about 200,000 jobs and perhaps a quarter of its tax base. Even the most passionate neighborhood mayors want downtowns full of high-paying jobs, although they may prefer to talk about other subjects.

But even if the distinction between downtown and neighborhood mayors is less than clear-cut, it’s still useful to observe that these two kinds of political leaders tend to alternate with each other. After a term or two of downtown romance, voters look for an urban populist eager to raise the concerns of the frustrated periphery. One way to see this is to look at New York over the past half-century or so.

Much of the gulf between center and periphery traces back to John V. Lindsay, who served from 1966 to 1973. Handsome, urbane and liberal, Lindsay never really escaped the perception that he was indifferent to the fate of the workaday neighborhoods, that he was an elitist politician focused on two widely disparate and limited constituencies: glamorous Manhattan and the pockets of poverty that surrounded it. He was viewed skeptically by the blue-collar neighborhoods of Brooklyn, Queens and the Bronx—the term “limousine liberal” was invented for Lindsay. By the time he left office, it remained only to be seen who would next play the role of neighborhood sympathizer.

Edward I. Koch played it pretty well for three terms ending in 1989. Riding the subways each morning and stopping outside the entrances to ask “How’m I doing?,” Koch persuaded voters in diverse corners of the city that he showed up and listened to their problems. Rudolph W. Giuliani accomplished much the same thing in a different way, using intrusive police tactics to deal with predatory violence that workaday neighborhoods placed first on their list of concerns.

Bloomberg never really had a chance to be a neighborhood mayor. He adopted most of Giuliani’s crime policies and made sure to be photographed riding the subway to work from his East Side townhouse, but as a Wall Street entrepreneur who flew to Bermuda on weekends, he had only one public persona open to him: that of the benevolent billionaire willing to spend a sizeable chunk of his fortune and his productive years building a city government as rational and competent as the organization he created in private life. This image played well enough to keep him in office for three terms, but by last year the voters were tired of it, even though most of them didn’t bother to vote. In retrospect, it all seems foreordained: Bloomberg’s successor would have to be a neighborhood mayor. De Blasio pressed that button, and it got him elected.

Ideally, of course, any big-city mayor would like to be the champion of downtown and the neighborhoods at the same time. But very few manage to do it. The mayor who has come closest in recent years is Boston’s Thomas Menino, who retired at the start of this year after a tenure that lasted 20 years—longer than that of any other mayor in the city’s history.

Menino wasn’t good-looking, articulate or exceptionally clever. He didn’t aspire to any job other than mayor of Boston, and he never seemed to be representing one urban cohort against another. He was a mayor for the whole city.

Menino was fortunate. He didn’t have to do anything dramatic to boost downtown Boston: The health care, finance and higher education industries took care of that problem essentially on their own. Menino presided benignly over the good news in the center, while devoting the lion’s share of his personal attention to small-scale commercial development in the neighborhoods. “In the years I’ve been in office,” he boasted one day toward the end of his second term, “we’ve built 12 supermarkets.” Those were the small victories Menino was most determined to take credit for—not stadiums or convention centers or aquariums, but grocery stores.

De Blasio should be so lucky. In New York, the economic gap between the center and the neighborhoods is an important reality. Some of that is the product of his own campaign for mayor. His primary constituency is looking to him to deliver on the redistribution of resources from center to periphery that he talked about during his campaign. But to accomplish that, he has to deal with downtown elites who wonder why a city whose center looks so sleek and prosperous really has to embark on a social revolution.