In fact, there's evidence most Republican primary voters aren't opposed to immigration reform. In a poll of Cantor's district commissioned by the liberal group Americans United for Change on Tuesday, 72 percent of voters expressed support for comprehensive reform—including 70 percent of Republicans. That might seem like a self-serving result given the source. But it's consistent with reams of other polls, including many by reputable nonpartisan and conservative pollsters. It's also consistent with the track record of Republicans who've been attacked in primaries for supporting immigration reform: Nearly all of them have won. Just last month in North Carolina, Republican Representative Renee Ellmers faced a challenge from an anti-amnesty activist who said that "multiculturalism is a problem for our country." Ellmers continued to vocally support reform and even called talk-radio host Laura Ingraham "ignorant" for opposing it. Ellmers won her primary, 58 percent to 41 percent.

Cantor's mistakes went beyond his immigration incoherence, as my colleague David Graham (no relation to Lindsey) has reported. His campaign was maximally disingenuous, attempting to tar Brat, a deeply religious Catholic and hardcore free-market libertarian, as a "liberal college professor." Brat believes Cantor's blitz of sleazy advertising actually helped the challenger by elevating his profile and making disgusted voters aware there was an alternative to Cantor. Meanwhile, activists resented Cantor's attempts to strong-arm the local GOP, his coziness with financial elites, and his focus on climbing the leadership ladder in Washington.

Graham is at least as ambitious as Cantor was. He just wasn't dishonest about it. He told his constituents, over and over again, why he felt it was important to be in the arena legislating and getting things done, rather than simply railing against a broken system and voting "no." But Graham made sure he didn't fall out of touch with his constituents, returning to South Carolina almost every weekend and cultivating a responsive service office modeled on that of his Senate predecessor, the late Strom Thurmond. (Thurmond famously held the seat for 46 years. On Monday, Graham joked, "The seat doesn't come open too often—let's keep it that way.") Graham also planned for a tough campaign from the beginning, whereas Cantor seems to have been caught by surprise. By the time he began pouring money into the race in April, it may have been too late.

The lessons Republicans are drawing from Cantor's defeat are clear: Stay the heck away from immigration reform—and fear the resurgent Tea Party. But the Tea Party's victories since 2010 have almost always come against incumbents who got complacent or stayed on past their prime. Graham's victory shows the lessons Republicans should take away instead: Be prepared. Run a smart campaign. And don't run away from what you believe, even when it comes to immigration.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.