Matt Rota

President Trump may have caved on his child-separation policy, after a public outcry that included significant members of his own coalition. But rather than waste time on self-congratulation, Republicans who spoke up this time should be asking themselves why a president of their party felt he was enforcing its principles by breaking apart families and caging children.

Not so long ago — less than a handful of years, even — you could still find prominent Republican voices willing to speak gently about immigration. (Remember Jeb Bush in 2014 calling illegal immigration an “act of love”?) But many, many other party leaders have been venturing ever deeper into the dank jungles of nativist populism for quite some time, exploiting the politics of fear and resentment. Mr. Trump did not invent Republican demonization of “the other” — it came about in two ways: gradually, and then all at once.

For a number of reasons — economic, cultural and demographic — immigration has been a growing concern among Republican base voters for decades. From the early 1990s to 2000, the conservative firebrand Pat Buchanan kept the Republican Party on its toes, running for president three times with an explicitly isolationist message. But it was during the George W. Bush years that anti-immigrant sentiment started to become more central to the party’s identity.

Mr. Bush made comprehensive immigration reform a priority of his second term. Multiple Senate bills emerged, built on the pillars of border security, a guest-worker program and a path to legalization for undocumented immigrants. But conservatives in the House rejected the idea of legalization and instead focused on border security. Conservative talk radio took up the cause, smacking Mr. Bush as squishy on immigration. The very concept of comprehensive reform became anathema to many on the right.

President Barack Obama also took a run at reform. And as with Bush 43, his efforts shattered when they collided with the Republican hard-liners in the House. The Great Recession that Mr. Obama inherited did nothing to quell nativist resentment among working-class whites, and the rise of the Tea Party pulled the Republican Party further to the right, with zealots on immigration setting the tone. Politicians who did not follow risked banishment.

Just ask Senator Marco Rubio, the Florida Republican, who saw his fledgling political career almost snuffed out by his flirtation with comprehensive reform. In early 2013, Mr. Rubio joined a bipartisan group of colleagues, nicknamed the Gang of Eight, to hammer out a grand compromise. This was in the wake of Mitt Romney’s presidential loss in 2012, after which the Republican Party briefly decided that one of its principal goals was to improve its image with Hispanic voters. The resulting plan would have done everything from beefing up border security to overhauling visa categories to promoting a merit-based immigration system. It also provided for the legalization of undocumented immigrants, which meant conservatives hated it. That June, the bill cleared the Senate by an impressive 68-to-32 vote. But John Boehner, then the House speaker, refused to bring it up for a vote in the Republican-controlled lower chamber.

For his efforts, Mr. Rubio became a pariah to the Tea Party voters who had propelled him to office three years earlier. Soon, he was denying that he had ever really supported the bill.

The immigration moves Mr. Obama made on his own — such as instituting protections for Dreamers and expanding deportation deferments — further enraged conservatives. Party leaders fanned those flames, accusing Mr. Obama of being imperious and “lawless.” In one bit of twisted logic, Mr. Boehner argued that the House couldn’t possibly take up reform legislation because it couldn’t trust Mr. Obama to carry out said legislation. Thus, the battle lines continued to harden.

Along the way, Republican candidates continued…