SOMETHING happened over the course of the past week that moved Newt Gingrich from a relevancy-challenged 15 points behind Mitt Romney in South Carolina to a dominant 40-to-28 win. What was it? The New York Times'exit polling doesn't give many answers. More than half of voters made their choice within a few days of the primary, but that was obvious from the swing in the polls. More significantly, "Six in 10 voters said it was important that a candidate shared their religious beliefs, and nearly half of them backed Mr. Gingrich, who has converted to Catholicism; about a fifth went for Mr. Romney, a Mormon." As my colleague writes, it looks like the Mormon factor is important, at least in heavily evangelical states. But that's a static issue; Mitt Romney wasn't any less Mormon a week ago, when he had a dominant lead, than he was on Saturday, when he got crushed. This seems like a better explanation:

For nearly two-thirds of voters, the recent debates were an important factor in their decision; for about 1 in 8 they were the most important factor. Mr. Gingrich was considered by many to have done particularly well in the debates; he received the votes of about half of those for whom the debates were important.

Newt Gingrich did two major things in the past ten days. The first was to launch a blistering attack on Mitt Romney as a greedy "vulture capitalist" who doesn't care about American jobs. The second was to turn in a confident, aggressive performance in two debates. And what was it that so impressed audiences about those debates? Was it Mr Gingrich's big ideas for the future? That seems doubtful, largely because, as Ross Douthat writes, it's not clear what they are.

I have, for my sins, watched Gingrich make his pitch across what feels like seventeen thousand Republican primary debates, and I am at a loss to identify the “big ideas” and “big solutions” that he is supposedly campaigning on. Yes, he has an implausible supply-side tax plan, but you never hear him talk about it. He has technically signed on to some form of entitlement reform, but you never hear him talk about that, either. Instead, so far as I can tell, his “idea-oriented” campaign consists almost entirely of promising to hold Lincoln-Douglas-style debates with President Obama, grandstanding about media bias and moderator stupidity, defending his history of ideological flexibility much more smoothly than Mitt Romney, and then occasionally throwing out a wonky-sounding notion (like, say, outsourcing E-Verify to American Express) that's more glib than genuinely significant. His last-minute momentum in South Carolina, which last night's debate did nothing to derail, has been generated almost exclusively by the politics of ressentiment: If he wins the Palmetto State primary, it will be because conservative voters don't much like the mainstream press, and Gingrich has mastered the art of taking tough questions and turning them into dudgeon-rich denunciations of the liberal media and all its works.

Mr Douthat thinks Mr Gingrich's success here hinges on his denunciation of the liberal media. I think the ressentiment here is actually more specific than that, and it sits significantly deeper. Mr Gingrich scored big on two points. The first was his insistence on terming Barack Obama the "food-stamp president"; my colleague is right to term this "expert racial dog-whistling". The second was the thunderous counter-attack against his disgruntled ex-wife's allegation that before their divorce 13 years ago, he had asked for an open marriage so that he could continue the affair he had begun with his then legislative aide, now his wife.

In the debates, in other words, Newt Gingrich hit two themes hard. The first was to link our black president with food stamps (and against hard work), and to angrily denounce the suggestion by a black media moderator that this could possibly be considered racial exploitation. The second was to blast the media for paying attention to his ex-wife's account of an extramarital affair. How might we characterise these themes? What is it about these two themes that makes them so appealing to the Republican voters who helped Mr Gingrich gain over 25 points on Mr Romney in ten days? I leave this exercise to the reader.