California wants no part of President Trump's America. Their battle is likely headed for the Supreme Court. Here's everything you need to know:

How is California resisting?
With nearly 40 million residents and the fifth-largest economy in the world, California is big enough to be its own country, and in many ways it has started to act like one. Gov. Jerry Brown and an overwhelmingly Democratic legislature currently enjoy one of the fastest-growing economies in the U.S., a booming clean-energy sector, and a $9 billion budget surplus. Confident of success, they're pursuing a liberal policy agenda diametrically opposed to President Trump's. As the Trump administration cuts financial and environmental regulations, weakens Obama-era programs, and cracks down on immigration, California is leading a coalition of blue states fighting back. It has sued the Trump administration nearly 40 times. "California has positioned itself as the center of the Trump resistance," said Los Angeles–based law professor Jessica Levinson. "It's bloody combat."

What are they fighting over?
Basically everything. Many disputes concern whether the Trump administration has ultimate authority to repeal or cease enforcing regulations involving student loans, net neutrality, birth control, farming safety, transgender rights, and banking protections, to name a few. More than a quarter of Californians are foreign-born, and the state has also been Trump's fiercest opponent on immigration. California challenged the Muslim travel ban last March, though the Supreme Court ultimately upheld it, and successfully filed suit against the "zero tolerance" policy of separating migrant families at the border. In addition, California sued to prevent Trump's repeal of the program that protects "DREAMers" who were brought to the U.S. illegally as children, and federal courts have temporarily blocked Trump's repeal. California's status as a "sanctuary" state was demonstrated in February when Oakland Mayor Libby Schaaf posted a tweet alerting residents of an upcoming immigration sweep. A livid Attorney General Jeff Sessions accused California of using "every power it has to undermine duly established immigration law."

Why is California so important?
The state's huge economy gives it outsize influence over national policy, especially environmental protections. With more than 35 million vehicles registered in California, auto companies can't afford to make one fleet of cars complying with federal rules and another fleet following stricter standards in California. The state reached its goal of reducing emissions to 1990 levels in 2016, four years earlier than targeted. In May, a coalition of 17 states led by California sued to block the Environmental Protection Agency from weakening auto emissions rules. "This is about health. It's about life and death," Brown said. "I'm going to fight it with everything I can."

How has Trump responded?
The president visited California in March and spent much of his trip inspecting prototypes for a wall along the southern border, seemingly to troll the majority of Californians who vehemently oppose his signature proposal. "The place is totally out of control," Trump said during his trip. "The governor's doing a terrible job." He said sanctuary cities "breed crime" and threatened to withhold federal funds as a "weapon" against California if it won't cooperate with immigration enforcement. This summer, Trump essentially blamed the state for its own wildfire crisis, arguing in a tweet that the blazes were "made so much worse by the bad environmental laws." His aides later argued that the state's strict limits on logging in forests set the stage for worse fires — a claim environmentalists and even the logging industry disputed.

Isn't the GOP for states' rights?
Yes, but Republicans argue that California is actually fighting to defend the federal overreach of previous Democratic administrations. Many of the state's lawsuits seek to force the federal government to continue a program or regulation, whether it's protecting wetlands, requiring oil and gas operators to reduce methane emissions, or providing health insurance under the Affordable Care Act. Some Republicans say politicians in California are merely seeking to capitalize on Trump's unpopularity there. "It's all a carefully orchestrated plan to distract California voters from what's really going on in the state," said California GOP Chairman Jim Brulte.

How will this end?
After California failed to stop the Federal Communications Commission from repealing net neutrality laws, the state passed its own strict standards last month, which the Justice Department immediately sued to prevent. "Once again the California legislature has enacted an extreme and illegal state law attempting to frustrate federal policy," Sessions said. Some of the lawsuits challenging the Trump administration — including those concerning sanctuary laws, auto pollution standards, and a proposed Census question about immigration status — will almost certainly be settled by the Supreme Court. The court now has a solid, 5-4 conservative majority, so California's attempt to chart its own course could be in jeopardy.

How did California turn so blue?
The state hasn't always been a liberal bastion. Richard Nixon represented California in the U.S. Senate, and Ronald Reagan served two terms as governor before running for president. The GOP's pull in California was probably at its greatest in the mid-1990s, when a harsh anti-immigration ballot initiative passed with the enthusiastic support of Republican Gov. Pete Wilson. Proposition 187 excluded unauthorized immigrants from government programs, including health-care services and schools, and forced law enforcement officers to report detainees' immigration status to federal authorities. A federal judge ruled the initiative unconstitutional, but it served to drive the growing Latino population to the Democrats. At the same time, large numbers of working-class Californians began moving out of the state for jobs, cheaper housing, and lower taxes, while college-educated workers moved in. So the state has steadily moved to the left. Democrats now have near supermajorities in both chambers of the legislature. Trump predicted he'd carry the state in an upset victory in 2016 but ended up with just 31 percent of the vote. Last month, Brown signed a bill moving the presidential primary up to March, ahead of all but four states, which should dramatically expand California's influence over both parties' nominations.