SACRAMENTO, Calif. — Thousands of miles from the union halls of Pennsylvania and Michigan, organized labor is flexing its muscles in a pitched battle with Big Tech.

And the Democratic Party's 2020 class isn't being shy about picking sides.

In a rare injection of presidential politics into a state policy debate, virtually every major Democratic White House hopeful except Joe Biden has waded into a California clash between labor unions and tech giants such as Uber and Lyft over the very definition of work in a changing economy. In the run-up to Labor Day, Democrats lined up behind a labor-backed bill that would make it harder for tech companies to classify workers as independent contractors, who aren't entitled to minimum wage or workers' compensation.

It's a debate with national implications that labor unions love and the tech giants that created the on-demand delivery industry loathe. It also marks a fresh test of organized labor's relevance and strength in the age of Donald Trump, who won the presidency in part by peeling away working-class voters long loyal to Democrats in a handful of pivotal Midwestern states.

But in 2020, just as the nature of labor is changing, so too is the notion of the "labor vote."

Voters in many traditionally union-dominated manufacturing areas were once a reliable Democratic constituency, but they have gradually drifted to Republicans, driven more by cultural issues such as guns, abortion and immigration than by wages, benefits and pensions. Union members also are shrinking as a total of the overall vote.

Still, in states with growing service and public sectors, labor has shown it is still capable of mounting large, influential campaigns on the minimum wage, health care and workers' rights. Democrats largely have fallen in line, risking blowback from donors and voters in the powerful tech industry.

"It says something about where the candidates think the primary voters are on this issue," said Zev Yaroslavsky, a former Democratic supervisor in Los Angeles County who now works at the UCLA Luskin School of Public Affairs. They "may believe that labor can be more helpful to them than the high-tech companies can be to them in a caucus state or a primary."

From its earliest days, the 2020 Democratic primary has highlighted the renewed power of organized labor in presidential politics.

Sen. Elizabeth Warren launched her candidacy at the site of a famous labor union strike in Lawrence, Massachusetts. Democratic front-runner Biden held his first rally at a Teamsters union hall in Pittsburgh. And under pressure from organized labor, Bernie Sanders recently added additional language to his "Medicare for All" plan to provide additional oversight for union members.

"Candidates understand that our members have sky-high expectations, and that's being reflected in their campaigns," said AFL-CIO spokesman John Weber.

The Democrats' intense courtship of organized labor reflects a new urgency for the party after Trump's relative success with working-class voters in 2016. Trump lost the majority of AFL-CIO voters nationwide, according to data collected the union, but he outperformed previous Republicans.

The courtship is playing out aggressively in California, which has a new, early primary date and new sway in the nomination process.

Warren was the first to comment on the dispute between labor and big tech in the state, prompting home-state Sen. Kamala Harris, also running for the White House, to follow suit. Sanders has pushed similar legislation at the federal level for years and has expressed strong support for the California proposal.

Among other candidates, Mayor Pete Buttigieg of South Bend, Indiana, rallied with rideshare drivers outside Uber's San Francisco headquarters last week, while former Texas Rep. Beto O'Rourke has outlined similar plans and New Jersey Sen. Cory Booker said he supports the bill.

Biden, a Pennsylvania native who casts himself as a champion for organized labor, is staying silent for now, perhaps weary of getting in the middle of two powerful interest groups.

The presidential attention has shone a spotlight on a growing political headache for an important part of the tech industry — headquartered in California — as it fends off pressure over privacy issues and election security. Democrats have struggled with just how cozy to get with tech companies that are revolutionizing the economy in ways many Americans enjoy but that are upending traditional business models.

In 2020, a candidate's willingness to confront big tech has increasingly become a sign of their progressive bona fides, even as they court young people who use the services and the tech workers who contribute to their campaigns.

While union membership is down nationwide, organized labor is positioned to lend significant resources to candidates. In 2016, for example, the total labor sector contributed more than $217 million to campaigns nationwide with almost 90% going to Democrats, according to the Center for Responsive Politics.

Beyond money, labor unions can provide volunteers to campaigns to help with knocking on doors, making calls and other essential work that often distinguishes successful campaigns.

If passed, California's law would be the strictest in the nation when it comes to classifying workers. The new labor would entitle workers to minimum wage, workers compensation, unemployment insurance and benefits such as paid sick days.

The rules would apply across the economy, but its impact on Uber, Lyft and meal delivery companies such as Postmates and DoorDash is dominating the debate. The companies say that treating their workers as employees would upend businesses designed around worker flexibility.

"We would become vastly different services," said Adrian Durbin, senior director of communication at Lyft.

This past week, Uber, Lyft and DoorDash threatened to spend $90 million on a November 2020 state ballot measure if they cannot make a deal specific to their workers.

The Democratic candidates don't seem to be buying techs arguments. Buttigieg rallied Tuesday in front of Uber's San Francisco headquarters with drivers on a three-day pilgrimage from Los Angeles to Sacramento. "If you're working a gig that means you're a worker and you ought to be protected as a worker," he said.

Harris, though a campaign spokesman last week, backed the bill even though she has ties to Uber, where her brother-in-law, Tony West, is general counsel. The consulting firm running her campaign, SCRB Strategies, is paid to lobby California lawmakers on Uber's behalf.

A change in California, the most populous state, is likely to have ripples across the country as both the federal government and the states wrestle with questions that arise from new technology and services.

Illustrating the stakes for labor about who controls the White House, the California law could set up a clash with the Trump administration, which has issued guidance saying gig workers are contractors, meaning they can't unionize. That's a reversal of the Obama administration.