A new case on the U.S. Supreme Court’s docket could potentially involve millions of American employees and lead to billions of dollars’ worth of litigation. The justices’ decision could affect the viability of religiously affiliated orphanages, hospitals, schools, and nursing homes, and it could also threaten the financial security of a generation of their workers, fast heading toward retirement.

On its face, Advocate Health Care Network v. Stapleton and the two other cases it’s consolidated with may seem boring—after all, they’re about federal regulations on pension plans for church-affiliated hospitals. But these cases are actually the culmination of a new, vicious fight over the rights of employers that are loosely affiliated with religious institutions, and how they should have to pay retirement benefits to their employees in accordance with federal law.

The three consolidated cases in question seem likely to turn on something deceptively simple: the single word “established.” In 1974, Congress passed a law called the Employee Retirement Income Security Act, or ERISA, which, among other things, created guidelines for defined-benefit retirement plans, otherwise known as pensions. The two most relevant requirements in these cases have to do with good planning and risk mitigation: Employers have to put money into their employees’ retirement plans in a responsible way, so that they can afford to pay out big sums of money once those employees get old. But, if a company is in financial trouble when it comes time to pay out the promised benefits, there’s a safety net: ERISA established the Pension Benefit Guaranty Corporation, or PBGC, which is effectively a government insurance agency for underfunded pension plans.

These rules do not apply to houses of worship. Benefit plans “established and maintained” by these groups are exempt. The reasons for this are a bit opaque, said Norman Stein, a professor at Drexel University’s Kline School of Law, but an early draft of the law suggests Congress “didn’t want churches to have to open their books to the government.” Legislators also figured religious groups weren’t the problem: “People felt that it’s the church—it’s not going to let its plan fail and screw its employees,” he said. “Some of the writing about the statute has speculated that this was a reason, too—churches are moral institutions that are going to stand behind their promise [to pay for people’s pensions], because that’s what religions do.”

When ERISA first passed, it wasn’t clear whether this exception would apply long-term to religious organizations that weren’t houses of worship, like Jewish day schools or Catholic hospitals. In 1980, Congress amended the law to clarify that religiously affiliated groups can also maintain what’s called a “church plan,” so long as they satisfy certain requirements. For years, the IRS allowed religiously affiliated groups to offer these “church plans” without much controversy. Since 1982, according the hospitals’ Supreme Court petition, it has sent over 500 letters granting ERISA exemptions to organizations as diverse as the Princeton Theological Seminary and the Little Sisters of the Poor, an order of nuns.

Three years ago, employees across the country began filing lawsuits claiming that these organizations shouldn’t be exempt, after all. Current and former employees of three health-care systems filed suit against their employers: Dignity Health in California and Saint Peter’s Healthcare System in New Jersey, which are both associated with the Roman Catholic Church; and Advocate Health Care Network in Illinois, which is jointly associated with the the Evangelical Lutheran Church in America and the United Church of Christ. This is where everything comes back to “established”: Because these pension plans weren’t “established” by actual churches, the employees argue, they shouldn’t be exempt from ERISA.

Under church plans, a “[pension] promise is only as good as the word of the hospital.”

The conflict matters for a few reasons. First, both sides arguably stand to lose incredible amounts of money. The Pension Rights Center, which supports the hospital employees, has identified at least three cases of allegedly failed church plans. When the owners of St. Anthony Medical Center in Illinois terminated one of its pension plans in 2012, the president and CEO told employees she was “very sorry for this surprising and disappointing news.” In 2013, the president and CEO of St. Mary’s Hospital in New Jersey wrote a letter to employees stating that “there simply are no funds remaining in the retirement plan’s trust.” And something similar happened last month at the now-closed St. James Hospital in New Jersey—the liability in that case is still murky.

Because these plans were not insured by the PBGC, they have left or may leave huge numbers of workers with less retirement money than they were promised. Hospital employees and their allies argue that church plans are a way for large employers to avoid complying with federal regulations—ones that were explicitly put in place to protect workers. Under church plans, a “[pension] promise is only as good as the word of the hospital,” Stein said. “If the hospital gets into financial trouble and the plan is not well-funded, you’re not going to get paid your benefits.”

But if these hospitals lose, they will also face intense financial consequences—and so will other religiously affiliated organizations across the country. Two appellate courts, the Third and Seventh Circuits, recently ruled against them, and “it is hard to overstate the burden and havoc these two decisions have created,” the hospitals wrote in their petition to the Supreme Court. If the lower-court rulings are affirmed, “this will mean renegotiating contracts with employees whose benefits are covered by collective-bargaining agreements, revamping benefit structures, redesigning pension-funding policies, and overhauling budget plans.”

There will also be future consequences: Under ERISA, employers are required to pay premiums to the PBGC and fund their pension plans at certain levels. When the law was created, “There was … a feeling that these kinds of church groups could not afford the cost of an ERISA plan,” said Howard Shapiro, a lawyer at Proskauer Rose in New Orleans, who has defended a number of hospitals that are being sued over their church plans. If these organizations are retroactively forced to comply with ERISA, they could face significant, and potentially ruinous, financial hardships.

The irony is that both religious groups and their employees could end up suffering if these hospitals lose at the Supreme Court. The church plans at issue “are still the old style of defined-benefit plans which everyone wishes they still had but don’t have anymore,” said Colleen Medill, a law professor at the University of Nebraska and counsel at the Koley Jessen law firm. “If [the hospitals] lose, and they pay whatever they have to pay in damages, they will probably, as a pure financial decision, freeze or terminate these plans and move over to a defined-contribution kind of plan.”

Defined-contribution plans typically include options like 401 (k) features, which have become much more popular in recent years—if you look at graphs of the number of organizations that have switched over to these plans, “they kind of look like the Nike swoosh,” said Medill. The reason behind this rise is straightforward: Defined-contribution plans shift the burden of bad economic times from employers to employees. A 401 (k) plan is great when the stock market is doing well, but “when the market goes down, maybe you don’t love that 401(k) plan so much because you bear the risk of market volatility,” Medill said. “In terms of retirement-income security, is it better to have an account that goes up and down every day with the market? Or is, it better to know that when I retire, I’ll get $3000 a month for life?”

In some ways, it’s surprising that all these issues are coming out now—ERISA has been around for 42 years, and Congress clarified the nature of church plans in 1980. In part, the delay is due the nature of retirement plans: People pay in over a long period of time, and they might not realize the consequences of being part of an uninsured pension plan until they’re about to hit 65 and realizing they don’t have the money they need to live.

“Churches didn’t write a letter saying, ‘By the way, we just decided to screw you.’”

But the delay also has to do with the way the IRS has dealt with religiously affiliated groups, Stein argued. “This went on for as long as it did [because] there was no regulation, no formal rule-making,” he said. During the 1990s and into the 2000s, a large number of religiously affiliated organizations won permission from the IRS to convert their pension plans into church plans. There were big incentives to do so: If they won church-plan status, the PBGC would refund a portion of the premiums they had paid in the past, which meant anything from a few thousand dollars to millions. Groups would get a private-letter ruling from the IRS, a form of guidance that does not set precedents for other taxpayers. But until 2011, when the agency began facing media scrutiny for what one amicus brief called “church-plan conversions,” organizations weren’t required to tell employees about the changes to their benefits plans. “By and large, employees didn’t even know it was happening—churches didn’t write a letter saying, ‘By the way, we just decided to screw you,’” said Stein.

Around the time a handful of plans began failing, a wave of lawsuits began—dozens have been filed since 2013, according to court documents. “There’s a whole movement among class-action lawyers where they see the potential to sue a very large plan and collect a lot of money in attorney’s fees and have some benefits for the employees,” said Medill. If the hospital employees win, “these employers are going to have to come up with a lot of money to fund these plans to come into compliance with ERISA.”

Not all churches and religious organizations dislike ERISA—in fact, any house of worship or religiously affiliated group can voluntarily choose to be subject to the law. “There are reasons to do that—namely to take advantage of federal preemption of state laws,” said Medill. ERISA limits the scope of what plaintiffs can win in a lawsuit, for example—if they operate in states that are more permissive, employers might find ERISA’s limited legal liability attractive. But that’s not what’s happening in these cases. “The real issue here is the funding requirement for the pension plans. If the plans were subject to ERISA, the employers would have to pay a lot more to fund these plans,” Medill said.

It’s hard to know how extensive the consequences of this Supreme Court decision could be. But they may not just be financial—Shapiro also sees the potential for religious-freedom conflicts. Under their church plans, religiously affiliated organizations can choose how they invest their money—pacifists can avoid putting money behind ammunitions companies, for example, or pro-life faiths can steer clear of investments related to abortion. Because ERISA imposes specific investment responsibilities on employers, Shapiro said, compliance “[could] actually conflict with some religious principles that are very important to these entities.”

These cases don’t break down along clear lines of good vs. evil. Various sides are trying to protect people who have compelling, conflicting needs, including employees who want to be able to survive retirement and hospitals with missions to follow their teachings and serve the poor. Everyone involved likely has some religious stake—many people who spend their lives working for religious hospitals are probably just as faithful as the organizations that employ them. There’s only one group that will really walk away victorious: As Medill put it, “This will be good for employment for ERISA lawyers.”