Today, a closely divided Supreme Court leveled a decisive blow against one of the last vestiges of the New Deal labor regime. After several flirtations in recent years, in Janus v. AFSCME the court finally overturned a 40-year-old precedent on the use of “fair-share” fees — charging nonunion members fees for the benefits they get from unions — in state and local governments.

The legal arguments were neither new nor novel, largely unchanged since the court’s initial unanimous decision in favor of the legality of the fees in 1970s. Instead, Janus is best understood as the latest iteration of a century-long struggle over the basic legitimacy of collective action in the government workplace — one that government workers are, once again, decisively losing.

By historical standards, the public-sector union, or at least formal collective bargaining by government employees, is relatively new. Traditionally, public workers had far fewer rights than their private counterparts and were barred from both bargaining and striking. Courts regularly refused to enforce contracts negotiated between unions and governments, and attempts to strike were aggressively broken, most famously when then-Gov. Calvin Coolidge crushed Boston’s police union in 1919. Largely bypassed by the legal revolution in trade unionism during the 1930s, government workers languished on the margins of legal legitimacy until the 1950s.

This basic pattern began to change only when, inspired by both the material success of their industrial counterparts and the moral clarity of the midcentury civil rights movements, a new generation of public-sector union activists demanded the full range of legal rights afforded to other workers. The growth of the private-sector labor movement, which peaked at about one-third of nonagricultural workers, helped strip collective bargaining of its more radical connotations, creating space for an intellectual revolution in public-sector labor relations.

Cities such as Philadelphia and New York began experimenting with collective bargaining arrangements. After a decade of intense lobbying, Wisconsin established the first comprehensive state-level system of collective bargaining in 1959. Drawing on these early examples and bowing to increasing pressure from his labor allies, in 1962 President John F. Kennedy issued an executive order extending limited bargaining rights to most federal employees. States jumped on the bandwagon, and by 1975, 36 states allowed collective bargaining for at least some of their workers.

In nearly every case, public employees continued to lack the full range of rights afforded to their private-sector counterparts, and they continued to rely on a combination of negotiation and lobbying to address their concerns. Nevertheless, the midcentury transformation of the public sector was dramatic. From 1955 to 1975, the total number of unionized government workers grew tenfold, to more than 4 million, and public workers emerged as the most dynamic, creative and militant wing of the U.S. labor movement.

But such legitimacy was always tenuous. As early as 1968, Fortune Magazine warned of the fiscal implications of the new public-sector militancy. When a strike produced an “unconscionably generous settlement,” journalist Irwin Ross suggested, “the public suffers twice — first from the disruption of services and then from the high price of labor peace.” He predicted that “the taxpayer will continually have to pay more to keep the schools open and the garbage trucks running” until pressures finally produced a taxpayer revolt.

Early instances of localized tax revolts indicated that Ross was prophetic: In 1971 and 1972, voters in Cleveland and Youngstown rejected revenue-increasing ballot issues, forcing the cancellation of contractual promises to public workers.

As the country grappled with the devastating new phenomenon of stagflation — a combination of a stagnant economy and soaring inflation — during the 1970s, public employers took a harder line in dealing with their employees, demanding concessions, issuing furloughs and canceling raises. The near-bankruptcy of New York City (averted, notably, by the willingness of city unions to use their retirement funds to cover the budget shortfall) seemed to validate charges that unionized government workers were bringing the country to the brink of collapse. Officials in city after city seized on the example, demanding concessions and cuts to prevent their towns from becoming “another Big Apple.”

Caught between soaring costs and lagging wages, public workers responded with a wave of militancy reminiscent of the upheavals of the Great Depression. In 1975 alone, there were nearly 500 strikes by state and local government workers.

But the timing of these strikes worked against public-sector unions. The increased militancy came at a moment when Americans were struggling and demanding lower taxes. This opened the door for conservative anti-union groups who had already been working to slow the growth of public-sector unionism. They pounced, challenging the basic legitimacy of public-sector unions.

Thanks to the ideas of law professor Sylvester Petro, challenging the legality of fair-share fees was one element of this assault. A former union member, Petro emphasized the threat posed by “compulsory unionism” to the orderly operation of government and the First Amendment rights of nonmembers.

Though the Supreme Court rejected these claims in Abood v. Detroit Board of Education (1977), crushing public employee unions became an increasingly important priority for conservatives during the late 1970s. At the fore was the Public Service Research Council, which stressed the danger posed by public-sector unions to the welfare of “citizen-taxpayers.” Activists such as Howard Jarvis seized on the argument, using the pay and benefits of government employees to push tax-cutting proposals such as California’s seminal Proposition 13. By the time President Ronald Reagan fired 11,000 air traffic controllers for participating in an illegal strike in 1981, the limits of the midcentury revolution in public-sector unionism seemed remarkably clear.

Despite these efforts, public-sector unions proved remarkably resilient, both in terms of their overall membership and their ability to protect hard-won gains, including traditional pensions, for their members. Even during Reagan era, unions such as the American Federation of State, County and Municipal Employees pioneered new bargaining practices like comparable worth, which boosted the pay and benefits of an increasingly feminized workforce. These unions even extended their reach to home-care and other fast-growing sectors of the U.S. economy.

Ironically, the very workers who had lingered on the margins of the New Deal-era labor movement emerged by the end of the century as its cornerstone. By 2010, roughly half of all union members worked for federal, state or local government.

But this success simply made public-sector unions a juicier target for critics. Their political vulnerability became clear with the onset of the Great Recession. In the midst of the most severe economic downturn since the 1930s, unionized teachers, nurses, janitors and sanitation workers came under political assault as overpaid and underworked.

In the name of fiscal discipline, Republican governors such as Scott Walker, John Kasich and Chris Christie targeted pensions, benefits and bargaining rights of public workers. Though the most visible efforts came from the political right, often with the financial and logistical support of well-established anti-union organizations, their arguments gained credence and legitimacy across partisan and ideological lines.

Only the death of Justice Antonin Scalia, which produced a 4-to-4 deadlock in a previous case raising the same issues as Janus, prevented the Supreme Court from imposing right-to-work restrictions on every government workplace in the country in 2016.

But today, the public-sector unions’ luck ran out.

The plaintiffs in Janus layered a potent populist critique of privileged government workers atop the seemingly mundane issue of fair-share fees. Because nearly every government workplace issue involves matters of public and fiscal policy, they successfully contended, the collective bargaining process is inherently political, and any requirement by the state that forces an individual to support the positions taken by a union amounts to a form of state-coerced political speech.

It was the same argument that conservatives had made in the mid-1970s. Then, the Supreme Court upheld the practice, in the name of labor peace and union power. Now, a far more conservative court has abandoned it, bringing a half-century-long process to a close and casting the U.S. labor movement into doubt and confusion. To have a future, American unions must reinvent themselves once again, by breaking down the barrier between taxpayer and tax-eater and by more clearly establishing their own benefits not just to members but also to the public at large.