In all their years in the little town, she said, neither she nor her husband, Eusebio Gomez, who is also undocumented, had ever encountered immigration authorities.

“We have lived here in peace. We built our lives in McFarland, working to support our family without any fear,” she said.

Her son Jesus made straight A’s in school, a source of pride for Ms. Ramirez, who is illiterate. Eusebio Jr. excelled at soccer and worked in the fields during his summer vacations to help the family.

Feeling settled and secure, the couple last year began discussing with their landlord the possibility of buying the two-bedroom house that they have rented from him for 13 years.

Then one day in mid-January, while she was pruning grapevines with her new red shears, her crew leader told her about a plan to refashion the prisons downtown into ICE facilities.

“Those two prisons three minutes from my house, they never bothered me,” said Ms. Ramirez, sitting in the tidy kitchen of her house before heading downtown for the protest march and hearing on Tuesday. “An ICE detention center, that would bring fear to our community. We might have to leave.”

Both GEO and the Justice Department have sued the state over the law banning new or renewed private prison contracts. In a bid to circumvent the law, signed by Gov. Gavin Newsom in October and effective in January, GEO and ICE signed an agreement in December to turn the state prisons in McFarland into federal detention facilities for immigrants, which they contend would still be legal.