Ofelia Rosas Ramos, an unauthorized immigrant, picked up her son from school in Seattle. She will apply for President Obama’s programs if they go forward.

Washington has long allowed immigrants without legal status to get driver’s licenses. So Ofelia Rosas Ramos, a Mexican living illegally in Seattle, has had her license since 2008.

“That is one of the big advantages of this state,” said Ms. Rosas, 31, whose 4-year-old daughter, an American citizen, has severe allergies. “If I have to rush her to the hospital,” Ms. Rosas said, “having a license, I don’t have to worry that I will be stopped by police and reported.”

Life is very different for Camila Trujillo, a Colombian immigrant living in Katy, Tex. Since Texas requires a Social Security number for a license, Ms. Trujillo, 21, drives to college and work without one.

“You can get pulled over for the smallest thing,” she said, and a police stop could spiral into deportation. “It’s frustrating and sad. We are not criminals. We want to live the American dream.”

President Obama was confident Tuesday that he would win the legal battle over immigration. “The law is on our side,” he said.

Esther Cervantes held Willie Morales, her grandson, at her home in Bakersfield. “I was expecting this to help me,” she said of the president’s plan. “But for me, there’s nothing.”

Workers at a union headquarters in San Francisco watched President Obama's televised remarks. Mr. Obama said millions of unauthorized workers could “come out of the shadows.”

This is immigration geography: Some states are reluctant to accept undocumented immigrants, while others are moving to incorporate them. And the polarization is sharply crystallized in a lawsuit by Texas and 25 other states against the executive actions by President Obama to give work permits and deportation protection to millions of undocumented immigrants.

“This case has brought the differences to the surface so vividly because it caused the states to pick sides,” said Roberto Suro, a University of Southern California professor who studies immigration.

Texas and its allies — among them Florida, Georgia, Indiana, Montana and Nevada — say they would be irreparably harmed if the initiatives took effect. Texas, with 825,000 eligible residents, said in the lawsuit that it would have to issue new driver’s and law licenses, and pay unemployment benefits — “injuries” that would be hard to undo if the courts ultimately found the president’s actions unconstitutional.

But in its legal papers, Washington cited “overwhelming evidence” that the programs would bring a host of benefits, raising wages for all workers and swelling tax revenues. It is leading a coalition of 14 states and the District of Columbia that is asking the courts to allow the programs to begin.

Those conflicting views could have a significant impact at the United States Court of Appeals for the Fifth Circuit in New Orleans, where the administration has filed a request to cancel a federal judge’s ruling in Texas that stopped the president’s actions, or to at least allow the initiatives to go forward in the states that agree with them.

The four million immigrants who would be eligible for Mr. Obama’s programs are about evenly split between the opposing coalitions. The court set a hearing for April 17.

Beyond the legal papers, though, the case has highlighted how the divisive politics of immigration have created vastly varying realities for unauthorized immigrants from one state to another.

In Washington, with its many service industries and fruit orchards, “there has long been a recognition of how important the immigrant community is to our economy,” said Jorge L. Barón, executive director of the Northwest Immigrant Rights Project in Seattle. “Everybody knows that undocumented individuals are crucial to agriculture in our state.”

The driver’s license policy, in effect since the early 1990s, has had durable support among voters because licensed drivers know safety rules and have insurance, regardless of their immigration status. Since 2003, Washington has also allowed undocumented students who came to the United States as children, known as Dreamers, to attend college at state resident tuition rates.

Iowa, where Gov. Terry E. Branstad is a Republican but Attorney General Tom Miller is a Democrat, is also siding with the president and asking for the programs to start.

An influx of illegal immigrants from Mexico and Central America to fields and meatpacking plants in Iowa, which brought political turmoil, peaked during the last decade and has subsided, said Mark Grey, a University of Northern Iowa professor who runs a job-training center for immigrants.

Many of those Latino immigrants have fully assimilated children who are American citizens. And most recent newcomers to Iowa have been legal immigrants and refugees from many countries around the globe.

“We don’t have the rancor we used to have,” Professor Grey said.

California is home to the largest population — about 1.2 million people — eligible to benefit from the president’s actions. And it has been the most active state in passing laws to make life easier for undocumented immigrants, with 26 new laws in 2014 alone, according to the National Conference of State Legislatures.

California now allows those immigrants to drive, practice law and attend college at in-state rates. The state also passed a law limiting police cooperation with federal enforcement of immigration laws.

“We acknowledge in California what we have to acknowledge as a country,” said Kamala D. Harris, the attorney general and a Democrat, who joined the legal effort by Washington. “Let’s get everyone on board with the fact that they’re here and we’re not going to deport them. Let’s figure out how to transition them in and get them to the point of assimilating.”

California turned away from policies of the 1990s that treated unauthorized immigrants as lawbreakers who burdened the public dole.

“I know what crime looks like,” said Ms. Harris, a career prosecutor who is running for the Senate in 2016. “An undocumented immigrant is not a criminal. Any discussion that perpetuates that myth is irresponsible and leads to bad public policy.”

Mr. Obama’s measures would give work permits and deportation deferrals to undocumented parents of American citizens, and expand an existing program for Dreamers.

The states opposing the administration include some, like Alabama, Arizona and South Carolina, that have passed tough laws designed to drive illegal immigrants out of the state.

But the biggest shift on the immigration map has come in Texas, which has the second-largest population of unauthorized immigrants. In 2001, Texas was one of the first states to grant in-state tuition rates for Dreamers. Now it is leading the charge against Mr. Obama.

The central point of the lawsuit is to stop what Texas and its allies regard as a lawless overreach by the president. But in Texas it also reflects a political change.

Following redistricting since 2010, Texas last fall elected its most conservative Legislature ever, said Jeronimo Cortina, a professor of political science at the University of Houston. And many Texans were alarmed by the surge of illegal migrants in the Rio Grande Valley last year, fearing the federal authorities were losing control of the border.

In the suit, Texas said the president was “rewarding unlawful behavior” by allowing immigrants without papers to stay and giving them benefits like work permits. The initiatives were “certain to trigger a new wave of illegal immigration” with “dire consequences” for the state, increasing its costs for services for migrants and additional police officers and National Guard troops at the border.

This year, lawmakers in Austin have considered bills to send 500 state troopers to reinforce the border, to require local police departments to cooperate with federal immigration agents, and to repeal the 2001 tuition law.

Ms. Trujillo, who came to the United States in 2008 with her parents, fleeing violence in Colombia, has felt the change. With no working papers, she is inching through community college, scraping by with a part-time job at the front desk in a television repair shop.

With a work permit, though, she would get her driver’s license, look for a higher-paying job and work toward a master’s degree in social work, she said.

“I have so many things I want to do with my life,” she said. “But in Texas right now, I’m just more and more limited.”

In Washington, Ms. Rosas said she came to the United States from Mexico in 2000 when she was 16. Without working papers, she settles for cleaning offices at night. She will apply for Mr. Obama’s programs if they go forward.

But, she said, “I am proud to live in this state.”