Voters in California on Tuesday passed a ballot measure mandating more space for certain farm animals and banning the confinement of egg-laying hens in cages.

Proposition 12, also known as the Farm Animal Confinement Initiative, also will eventually ban the sale of agricultural products in California that don’t meet the state’s new requirements. That means the new law may influence how farmers across the country raise their animals.

We did it, California!!!! pic.twitter.com/spdZK2DbNf — Yes on Prop 12 - Prevent Cruelty CA (@YesOnProp12) November 7, 2018

What exactly does Prop. 12 do?

Proposition 12 has two sets of requirements ― one that kicks in 2020, and a second that takes effect in 2022. By 2020, agricultural operations in California must provide egg-laying hens with at least 1 square foot of space per hen, and must provide at least 43 square feet of space for each calf raised as veal.

By 2022, farms in California must provide female pigs used for breeding with at least 24 square feet of space per pig. Hens must be kept in cage-free housing providing at least 1 square foot of space per hen.

The 2022 requirements also mandate that agricultural products sold in California must meet the state’s livestock space requirements, even if they come from out of state.

Enforcement will be up to the California Department of Food and Agriculture and the Department of Public Health, and will be complaint-based, a spokeswoman for the American Society of the Prevention of Cruelty to Animals told HuffPost.

FABRIZIO VILLA via Getty Images Hens in battery cages in Italy in 2005.

Why these specific types of animals?

Battery cages for egg-laying chickens, veal crates for calves, and gestation crates for breeding pigs are some of the most severe forms of animal confinement on modern farms.

Battery cages are rows of small, packed cages that give birds little room. Veal crates are small enclosures that prevent calves from moving around. And gestation crates are used to confine mother pigs for months in cages that, as they grow larger during pregnancy, can leave them virtually immobilized, unable to even lie on their sides.

Some states already have legislation that bans or restricts one or more of these forms of confinement. Many farms elect not to use them.

The life of a breeding pig is one of extreme confinement, stress and suffering. They spend nearly their entire lives pregnant, confined to a gestation crate where they can’t lie down or turn around. NO animal deserves to suffer this way. 💔 pic.twitter.com/G5EbSAYwYu — The Humane League (@TheHumaneLeague) March 26, 2018

Who supported Prop 12, and who opposed it?

Proposition 12 had strong support from animal protection groups, including prominent organizations like The Humane Society of the United States and the ASPCA. It also gained the support of some consumer advocacy groups.

Opponents included several agricultural industry groups, but also People for the Ethical Treatment of Animals. PETA argued that the law did not improve the lives of animals enough, and would lock in inadequate standards that would mislead consumers.

This sounds really familiar. Did California do something like this before?

Yes. In 2008, California voters passed Proposition 2, which also set space requirements for egg-laying hens, veal calves and breeding pigs. However, this law did not establish specific square footage, but instead included language saying that animals must have room to freely move around.

Though supporters intended this law to banish cages for chickens, state officials ultimately ruled that farmers could keep cages as long as they were large enough to comply with the space requirements, according to NPR.

Then, in 2010, state legislators passed a additional bill that prohibited the sale of eggs from other states that didn’t meet those space requirements.

How could this affect farms in other states?

Prop. 12 establishes that out-of-state farms that don’t meet California’s requirements for eggs, veal or pork cannot sell their products there. Though this was already the case for out-of-state egg producers, Prop. 12 makes the space requirements for hens more specific and expressly states that egg-laying hens must be kept in cage-free housing.

Massachusetts passed a similar measure in 2016, set to go into effect in 2022.

California legislation is the main reason that Rep. Steve King, an Iowa Republican and noted white supremacist, added an amendment to this year’s draft federal farm bill called the Protect Interstate Commerce Act. The addition, also known as the King Amendment, would prohibit states from passing laws affecting the sale of out-of-state agricultural products, as long as out-of-state products comply with federal law or the laws of their own state.

In other words, if the farm bill passes with the King Amendment, California could not ban the sale of eggs from caged hens, since those cages are legal under federal law and in many states that produce eggs. In addition, critics of the King Amendment fear that its vague wording could have a cascading impact that could invalidate countless laws related to animal welfare, food safety, invasive species and public health.