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.