Perhaps more important, protecting the children known as Dreamers (the beneficiaries of the Deferred Action for Childhood Arrivals program) is not seen by the public as the same as other immigration issues. Most people — including many Republican voters — believe that once people have lived in the country for years, held a job, learned English, and are willing to pay back taxes, they should be able to stay.

Whether President Trump’s recent moves are politically naïve or shrewd turns on how worried he is about losing support among the Republican voters whom he courted specifically over illegal immigration, and whether these voters think that an agreement on DACA portends a broader softening on border control. His base has stuck by him through many unimaginable episodes: Mr. Trump himself described their loyalty by saying that he could “stand in the middle of Fifth Avenue and shoot somebody” and wouldn’t lose voters.

He might be right. Gabriel Lenz, a University of California, Berkeley, political scientist, has written a book about what happens among voters when leaders change positions on issues. The book is titled “Follow the Leader?” which gives you a hint of how things turn out. On most issues, when candidates change their minds, supporters will mimic the change instead of abandoning the candidates. As the book description says, “In many cases, citizens first pick a politician and then adopt that politician’s policy views.”

But President Trump might also be wrong about this. Using similar methods to Mr. Lenz’s, Michael Tesler, a political scientist at the University of California, Irvine, has conducted research on long-held predispositions, like views about people who are “different from you.” Mr. Tesler found that voters are less likely to change those kinds of positions to follow their party leaders. Candidates who change their minds on straightforward policy issues like the tax rate are likely to see their voters change their minds on those issues. The same is not true for topics drawing on racial or ethnic attitudes.

Mr. Trump regularly changes his mind on all sorts of things, so if his voters don’t come along, he could always return to his earlier position to court them. He has done it before on immigration. After the 2012 presidential election, Mr. Trump criticized the Republican Party for its loss and warned that the party would “continue to lose presidential elections if it comes across as meanspirited and unwelcoming toward people of color.”

He went on to compliment the Democrats on immigration — not on their policies, but on their tone. “They didn’t have a policy,” he said, “but what they did have going for them is that they were not meanspirited about it.”

“What they were is they were kind,” he added.

Mr. Trump’s tone three years later was much less kind than the party line in 2012. He even criticized a Republican primary opponent, Jeb Bush, for saying that illegal border crossings were motivated by an “act of love” and commitment to family. Now, he’s testing the deep affection of his base once again by seemingly going back to a kinder approach on immigration.