The Democratic primary should serve as convincing evidence of how quickly and dramatically political fortunes are turned around in New York City. Just a few months ago, most political pundits had all but declared City Council Speaker Christine Quinn as the winner of the Democratic nomination. Shortly after, the city’s political class was fascinated with the emergence of former Rep. Anthony Weiner in the campaign, contending that he, too, might well be the next mayor. But Tuesday’s primary underscored how in the final analysis, it is the voters who determine the makeup of the city’s leadership. And what has made this election particularly fascinating is the role of the African-American electorate and African-American candidates, who somehow never seem to sufficiently factor into the calculations of the pundits.

For one thing, political pundits are always quick to paint the Black vote as one that is monolithic, that somehow Black voters rarely if ever look at elections through nuanced lenses. If there is a Black candidate in a Democratic race, to these observers it stands to reason that all Black voters will vote for that candidate. Anyone who subscribed to that political view was left with no shortage of head-scratching from the results of Tuesday’s election.

While Bill de Blasio is indeed white, his campaign clearly touched a nerve within the city’s Black community. His fierce and dogged criticism of Mayor Michael Bloomberg’s horrendous stop-and-frisk program, complete with a compelling television ad, drew a large swath of Black voters to the de Blasio camp. And while Bill Thompson, the only African-American candidate in the Democratic primary, did respectably in the city’s Black communities, de Blasio managed to capture the larger share of the vote in majority-Black communities.

In fact, a preliminary analysis of the vote indicates that de Blasio won 47 percent of the vote in areas of the city where Black residents account for at least 50 percent of the population, compared with Thompson, who received 34 percent of the vote in those same areas. What that reveals in stark clarity is the fact that Black people vote based on issues that are important to them.

Stop-and-frisk has become a lightning rod issue in communities of color. With millions of young Black and Brown youth stopped and detained by New York City police in the last four years, it is a chilling reality that has touched nearly every African-American household in New York City. And so, de Blasio’s outspoken and vehement denouncement of stop-and-frisk became an issue that grabbed the attention of Black voters, who were then introduced to the candidate’s resonant “Tale of Two Cities” theme.

Another important lesson of the 2013 Democratic primary is the fact that it has become virtually impossible to win a race without significant support of the city’s Black and Brown electorate. Anyone who doubts that should just ask soon-to-be ex-Brooklyn District Attorney Charles J. Hynes, whose loss to Kenneth Thompson, his Black challenger, seemed to take all the shocked pundits by surprise.

Early in the election season, when political pundits declared Quinn the all-but-official Democratic nominee, they neglected to factor in the paltry support that the City Council speaker had in communities of color. Her about-face role in carrying Bloomberg’s water on term limits coupled with her invisibility on the issue of stop-and-frisk did not endear her to most Black and Brown voters, who were already not enthusiastic about the prospect of a Bloomberg II administration.

The biggest lesson for political pundits who wish to evaluate the New York electorate with any accuracy is that it is a landscape that is not best studied from midtown office buildings or discussions among themselves. Instead, if they are to have any credibility, they must go out to communities of color and discover how sophisticated, passionate and analytical Black voters really are.