In the closing days of the campaign for the midterms, President Trump has clearly decided that immigration should be the central issue of this election. Mr. Trump called a caravan of Central Americans heading toward the United States it “an assault on our country” and asserted without evidence that it includes “bad people” and “unknown Middle Easterners.” He accused Democrats of having “something to do with it.” He floated the idea of ending birthright citizenship for children born in the United States to undocumented immigrants. He circulated an ad about a Mexican man convicted of killing two police officers that said, “Democrats let him into our country.”Mr. Trump’s focus on immigration has had real consequences, even though congressional candidates across the country have chosen to focus on other issues, like the economy or health care. Compared to recent elections, voters’ beliefs about immigration are more strongly related to how they plan to vote in congressional races. This shows how Mr. Trump is shaping how Americans vote even though he’s not on the ballot. His brand of identity politics has metastasized to states and districts across the country.The importance of immigration in 2018 has its roots in 2016. In the presidential election, attitudes toward immigration became more strongly correlated with voting for Mr. Trump or Hillary Clinton than they were with voting for Barack Obama or Mitt Romney in 2012. The increased role of immigration attitudes stemmed from the 2016 campaign itself: Mr. Trump and Mrs. Clinton took sharply divergent positions, embodied in Mr. Trump’s call to “build the wall” and Mrs. Clinton’s argument that our diversifying nation was “stronger together.” Our research has shown that it was attitudes about identity-inflected issues like immigration — not a purely “economic” anxiety — that were distinctively important in 2016.Mr. Trump’s victory helped him reshape how Americans see the Republican Party. Evidence from previous presidential administrations shows that presidents can influence their party’s image. Already, Mr. Trump has pushed public perceptions of his party’s position on immigration further to the right — just as he helped make the party appear more favorable to Russia and Vladimir Putin. Only a few years ago, immigration policy created a genuine debate within the Republican Party, and a visible faction of Republican politicians wanted a moderate compromise. Mr. Trump has arguably marginalized that faction.Because Mr. Trump has linked the party to his position on immigration, white Americans’ views of immigration now predict their vote for Congress more than in recent elections. To show this, we use data on the same set of 2,700 white respondents interviewed in December 2011, November 2012 and May 2018 in the Views of the Electorate Research Survey.In 2011, this survey asked whether immigration to the United States should be easier or harder, whether there should be a path to citizenship for undocumented immigrants, and whether undocumented immigrants were mostly a benefit to or a drain on society. White Americans were divided on these questions: 48 percent wanted to make it easier to immigrate or keep it the same, while 44 percent wanted to make it harder (the rest were unsure). Similarly, 37 percent favored a path to citizenship, 42 percent opposed it and 22 percent were unsure. And while the majority (58 percent) said that undocumented immigrants were a drain, there were obviously many Americans who felt differently. We combined answers to these three questions to produce an overall measure of views about immigration.In 2012, white Americans did not appear to act on these views as much as they seem likely to in 2018. These 2011 views on immigration are more strongly correlated with how whites said they would vote in elections for House as of May 2018 than with how they actually voted in the 2012 House election. This is true even after accounting for other factors related to how people vote, including their identification as Democratic, Republican or independent and whether they described themselves as a liberal, moderate or conservative.The growing importance of immigration to voting for Congress isn’t because of congressional candidates themselves. Over the past month, 8 percent of televised political ads in House and Senate races have talked about immigration, including 13 percent of ads supporting Republican candidates. Mr. Trump may be doubling down on immigration, but congressional candidates are not: These percentages are no higher than in 2014 and 2016. Instead, Mr. Trump’s emphasis on immigration may have led voters to increasingly connect their attitudes on immigration to their congressional vote.Will this renewed debate over immigration helps the Republican Party’s chances in 2018?That’s far from clear. In 2016, Mr. Trump benefited because many white Obama voters disagreed with the Democratic Party on immigration. In December 2011, about a third of white Americans who would go on to vote for Mr. Obama believed that it should be harder to immigrate to the United States. Once the 2016 campaign made immigration a bigger issue, some of these white Obama voters who wanted restrictions on immigration shifted to Mr. Trump.But much has changed since the 2012 election and even since 2016. Public opinion has become more favorable toward immigration — a trend driven mainly by Democrats who are reacting against the Trump administration’s policies. For example, in Pew Research Center surveys, the percentage of Democrats who believe that immigrants strengthen the country increased from 62 percent in May 2015 to 84 percent in June 2017. The percentage of Democrats who want to increase immigration has also increased. These Democratic shifts on immigration are larger than on many other issues. For example, over the past three years Democratic support for government regulation of business and the Affordable Care Act has been stable.After Mr. Trump’s remarks about the migrant caravan, a senior administration official said: “It doesn’t matter if it’s 100 percent accurate. This is the play.” And perhaps this is the best play the Republican Party has. The growing economy’s political impact appears muted: Mr. Trump is far less popular than he should be given how positively people feel about the economy. The Republican tax plan also remains unpopular. Moreover, survey data show that the people who consider immigration an important issue tend to be more anti-immigration than other Americans. Maybe Mr. Trump’s remarks will help mobilize these voters. He certainly seems to think so.But immigration may not be as effective a wedge issue in 2018. Immigration no longer divides Democrats as much as it used to. This shows how Mr. Trump is reshaping not only his own party, but the opposition. The result is fewer and fewer white Democrats who could be persuaded by Mr. Trump’s message on immigration.This increasing polarization of the parties ensures a debate about immigration that extends well beyond this election. And it will be a particularly divisive and emotional debate precisely because immigration touches on fundamental questions about who deserves to be in America and what it means to be American in the first place.These are the questions that Americans will help to answer on Tuesday.John Sides, Michael Tesler and Lynn Vavreck are the authors of “Identity Crisis: The 2016 Presidential Campaign and the Battle for the Meaning of America.”Follow The New York Times Opinion section on Facebook, Twitter (@NYTopinion) and Instagram.