A case that had the potential to weaken public sector unions across the United States ended with a somewhat unexpected victory for unions on Tuesday, as the Supreme Court divided 4-4 on the question of requiring nonmembers to pay a fee to the public sector union that negotiates the collective bargain agreement that covers both members and nonmembers.

The split vote in Friedrichs v. California Teachers Association means a lower court verdict in favor of the union stands.

A decision against the unions would have made the 23 states with those fees, known as agency fees, into "right to work" states, where unions can't force nonmembers to cover the cost of collective bargaining and where union membership is consequently much weaker.

The 4-4 decision suggests that, if Justice Antonin Scalia were alive, the case could have turned out much differently.

The split vote, the first major decision on a Supreme Court case since his death in February, shows how much of an impact his absence has had.

The case could have made every state into a "right to work" state

Workers can't be required to join a union. But in 23 states, public sector employee unions can require workers who aren't union members to pay dues anyway.

The case, Friedrichs v. California Teachers Association, challenged the constitutionality of those fees. Unions argue they are necessary because all workers benefit from the contract agreements they negotiate, even if they're not union members.

Unions call these fees "fair-share fees." (The neutral term is "agency fees.") The fees vary, but they're often not much less than member dues. Nonmembers can opt out of funding unions' lobbying and political activity, but they're stuck with the fair-share fee regardless.

In California, an agency-fee state, teachers who aren't members of the union are required to pay $410 in annual fees to support the unions' nonpolitical activities. The full union dues are more, $644, and 9 percent of teachers choose to opt out and pay the agency fee instead.

Ten California teachers who opt out argued they shouldn't have to pay the agency fee, either, because collective bargaining itself is an inherently political activity. The union takes positions on education policies, including grievance and dismissal procedures that provide job security but can make it more difficult to remove teachers from the classroom.

It's not clear if limiting unions' abilities to collect agency fees would curtail their power dramatically or only somewhat. But the power of public sector unions is the underlying issue in the case.

Unions are far more powerful in the public sector than in the private sector: 36 percent of public employees belong to a union, compared to 7 percent of private employees.

If unions can't require nonmembers to contribute anything, but are still required to negotiate for nonmembers in collective bargaining, there's less reason to join a union. And while a relatively small percentage of union members currently opt for fair-share fees rather than full dues, that's different than the choice between paying dues and paying nothing.

With Scalia on the court, this case could have gone differently

Friedrichs v. CTA was always destined to end up at the Supreme Court, because getting rid of agency fees would have required overturning a precedent. And oral arguments in January suggested that, before Scalia's death, the court had five votes to do just that.

In Abood v. Detroit Board of Education in 1977, the court held that unions cannot require nonmembers to pay to advance the unions' political views, but that it was constitutional for unions to ask nonmembers to pay for the cost of collective bargaining, contract administration, and the grievance process.

But in recent years, two cases suggested that the Supreme Court would be open to reconsidering Abood, given the right case.

In Knox v. SEIU, decided in 2012, the court held that unions must give nonmembers another chance to opt out of fees assessed during the year, after the regular agency fees are set, if those fees are to be used for political purposes.

In Harris v. Quinn, decided in 2014, home health aides in Illinois sued over their fair-share fee. But the court decided that the home health aides were not full-fledged public employees and so, although they ruled those workers did not need to pay fair-share fees, the decision's impact wasn't as sweeping as it could have been.

Oral arguments in Friedrichs bolstered that impression. Scalia, unusually, was considered the swing vote, because despite being one of the court's most stalwart conservatives, he had sympathized with unions in the past. In an opinion in 1991, he argued that because unions are required to advocate for both members and nonmembers — they can't negotiate a higher salary that applies only to their members, for example — they end up benefiting "free riders."

But oral arguments suggested that Scalia siding with unions in 2016 was a pipe dream. He compared agency fees to a law requiring people to subsidize the Republican Party:

The problem is that it is not the same as a private employer, that what is bargained for is, in all cases, a matter of public interest. And that changes the —­­ that changes the situation in a way that, that may require a change of the rule. It's one thing to provide it for private employers. It's another thing to provide it for the government, where every matter bargained for is a matter of public interest

The court doesn't issue opinions when it divides and sends the case back to a lower court. So there's no way of knowing for sure that, if Scalia had lived, the decision would have been 5-4 against the union rather than for the plaintiffs. The available evidence from oral arguments suggested that it might have been.

But the fight probably isn't over for long. It's possible that the case could again be appealed to the Supreme Court to be heard by a nine-member bench.

Even without Scalia, and even if President Barack Obama (or a future Democratic president) succeeds at replacing Scalia with a more liberal jurist, the court still has four votes in favor of overturning its 1977 precedent — and that's enough votes to ensure that a case on this issue, and perhaps even this specific case, will end up before the court again.