In June, when Alexandria Ocasio-Cortez, a Latina organizer, unseated Joe Crowley, one of the most powerful Democratic incumbents in the country, many analysts were shocked. But maybe they shouldn’t have been.

Ms. Ocasio-Cortez’s victory came after she criticized Mr. Crowley regularly on the campaign trail for voting to establish the Immigration and Customs Enforcement agency in 2002. She called for the agency to be abolished. And as she zeroed in on the brutality of immigration enforcement, she became a leader in the movement to abolish ICE, going so far as to spend the last few days of her campaign at the border bearing witness to the viciousness of America’s immigration system.

While some saw this as a sign of her political weakness, Ms. Ocasio-Cortez was tapping into a sharp shift in the way that Democrats understand immigration. In much the same way that the Democratic Party has had a reckoning on financial deregulation, the punitive 1994 crime bill and the callous welfare reforms of the mid-90s, incumbents are now facing criticism for their votes on immigration.

From the Illegal Immigration Reform and Immigrant Responsibility Act in 1996 to the Homeland Security Act of 2002, Democrats have voted overwhelmingly to help construct the apparatus that President Trump is using to engage in a campaign of mass deportation. And candidates like Ms. Ocasio-Cortez are forcing them to take those votes seriously. Ayanna Pressley, who is challenging another incumbent, Michael Capuano, in the Seventh Congressional District of Massachusetts, has also called for abolishing ICE. In Delaware, Kerri Evelyn Harris, running against Tom Carper, another incumbent who supported the creation of the agency, has too.