Another large factor has been the decline in urban violence.

As the historian Rick Perlstein documents in his terrific new book “Nixonland,” America’s hard right turn really began in 1966, when the Democrats suffered a severe setback in Congress  and Ronald Reagan was elected governor of California.

The cause of that right turn, as Mr. Perlstein shows, was white fear of urban disorder  and the associated fear that fair housing laws would let dangerous blacks move into white neighborhoods. “Law and order” became the rallying cry of right-wing politicians, above all Richard Nixon, who rode that fear right into the White House.

But during the Clinton years, for reasons nobody fully understands, the wave of urban violence receded, and with it the ability of politicians to exploit Americans’ fear.

It’s true that 9/11 gave the fear factor a second wind: Karl Rove accusing liberals of being soft on terrorism sounded just like Spiro Agnew accusing liberals of being soft on crime. But the G.O.P.’s credibility as America’s defender has leaked away into the sands of Iraq.

Let me add one more hypothesis: although everyone makes fun of political correctness, I’d argue that decades of pressure on public figures and the media have helped drive both overt and strongly implied racism out of our national discourse. For example, I don’t think a politician today could get away with running the infamous 1988 Willie Horton ad.

Unfortunately, the campaign against misogyny hasn’t been equally successful.

By the way, it was during the heyday of the baby boom generation that crude racism became unacceptable. Mr. Obama, who has been dismissive of the boomers’ “psychodrama,” might want to give the generation that brought about this change, fought for civil rights and protested the Vietnam War a bit more credit.

Anyway, none of this guarantees an Obama victory in November. Racial division has lost much of its sting, but not all: you can be sure that we’ll be hearing a lot more about the Rev. Jeremiah Wright and all that. Moreover, despite Hillary Clinton’s gracious, eloquent concession speech, some of her supporters may yet refuse to support the Democratic nominee.

But if Mr. Obama does win, it will symbolize the great change that has taken place in America. Racial polarization used to be a dominating force in our politics  but we’re now a different, and better, country.