Companies have been cutting back or eliminating health benefits for former workers, with many retirees being pushed on to public health insurance exchanges.

For decades when thousands of workers in Illinois and Kentucky went into the mines each day for Peabody Energy, they did so expecting the company to take care of their health when they retired.

And for a while, retirees did receive a pension and health benefits for themselves and their dependents.

Then everything changed.

In 2007 Peabody spun off some of its mines and healthcare obligations to a newly created company: Patriot Coal.

Then Patriot filed for bankruptcy in 2012.

As part of this deal, Peabody and Patriot both agreed to pay into a special fund — known as a Voluntary Employees’ Beneficiary Association, or VEBA — to cover the health claims of the retirees.

The fund, though, fell far short of the $1.45 billion needed to cover healthcare obligations to the companies’ former workers.

Earlier this year, Patriot filed for bankruptcy once more, putting at risk the health benefits of 11,000 more retirees of Peabody as well as another mining company it had acquired.

As part of the new bankruptcy settlement, a Virginia court allowed Patriot to stop making its payments to VEBA. And Peabody is now trying to get out of its remaining payments if Patriot can.

Unless the courts can compel Peabody to make its scheduled payments into VEBA, the health benefits fund will soon run dry.

“The VEBA would run out of money sometime in January,” Phil Smith, director of communications and governmental affairs for the United Mine Workers of America, told the St. Louis Post-Dispatch. “The amount of money that was going into that was about equivalent to what it cost per year for those benefits.”

Read More: Miners at Higher Risk of COPD »

The erosion of health benefits for retirees is not new.

“There’s been this broader trend away from retiree health benefits for the better part of 30 years now,” Paul Fronstin, Ph.D., a senior research associate with the Employee Benefit Research Institute, told Healthline.

Between 1997 and 2010, the percentage of retired workers over the age of 65 receiving health benefits from their former employer dropped from 20 percent to 16 percent.

Part of the reason is a change in the way non-pension benefits are accounted for on corporate balance sheets. A regulatory requirement mandated that retirement health benefits be reflected in a company’s profit and loss tables — and “not in a positive way,” said Fronstin.

Employers may also be realizing how expensive it is to provide health insurance for retirees, especially as people live longer.

“The costs are a lot higher than they were predicted to be many, many years ago,” said Fronstin.

Employers are also reacting to changes in healthcare prompted by the Affordable Care Act (ACA).

At one time, employers may have offered health benefits to their retirees because there were few other options, especially for people too young for Medicare.

“Today retirees have some place to go. They’ve got the public exchanges,” said Fronstin. “But more importantly is the insurance market reforms that go along with those exchanges.”

The ACA prohibits retirees from being denied coverage because of pre-existing conditions, places limits on how much they can be charged for premiums because of their age, and offers subsidies for low-income retirees.

In some ways, retirees are better off finding health insurance through the public exchanges than picking one of the few plans offered by their former employer.

“This gives them the opportunity to choose the plan that’s right for them,” said Fronstin.

Read More: Scoring Obamacare After Two Years »

Companies handle retiree health benefits in different ways.

“A number of the retiree associations affiliated with the NRLN have lost their healthcare benefits,” Ed Beltram, vice president of communications for the National Retiree Legislative Network, said in an interview with Healthline. “Or the companies, instead of providing a healthcare benefits plan, are providing them a certain amount of money to purchase their own healthcare.”

These health insurance subsidies, though, may be a far cry from the benefits once enjoyed by retirees.

This type of reimbursement “generally doesn’t cover the full cost,” said Fronstin. “What portion it covers depends upon which plan you choose.”

Other employers may require that retirees use specific health insurance plans.

Companies are “creating their own exchanges, or moving to private exchanges,” said Fronstin, “which basically mimics what’s happening with the public exchanges”

One benefit of these exchanges, said Fronstin, is that right now they tend to not restrict retirees to certain doctors and hospitals. Many plans available through the public exchanges have lower premiums, but also smaller networks.

Read More: Medicare Requirements: Who Is Eligible? »

It may be difficult for retirees to fight back against the loss of health benefits, even if they are unionized.

“I think it’s happened less in the public sector and in collectively bargained plans,” said Fronstin, “but it’s happening there, as well.”

Even before the recent declines in employer-provided retiree health benefits, companies had a way out of the obligation.

Companies included “reservation of rights” clauses in benefits plans, said Beltram, “which in essence said the company has a right to change or eliminate these benefits at any time.”

The warning signs of unhealthy pensions may offer some advance notice of impending benefits changes. These include the company appearing to be on shaky ground, changing hands, or selling or spinning part of itself off to a new company.

But unlike the laws that protect pension plans, said Beltram, “there’s never been healthcare protection legislation.”

Over time, more companies will likely push retirees on to public or private health insurance exchanges, with mixed results.

Fronstin said that some retirees will welcome the chance to choose their own health insurance while others will dread taking on this new task in their retirement.

“Some of them are going to hate it and some of them are going to love it,” said Fronstin.

Read More: Why Some People Don’t Buy Health Insurance »