Here's a feature of Obamacare you probably don't know about: A transfer of hundreds of billions of dollars in liabilities to retired public employees from state and local governments to federal taxpayers.

Here's how it's going to work.

States and localities have enormous liabilities in the form of health benefits they have promised to provide to retired workers. (Finance professionals call these benefits OPEB, or "other post-employment benefits.") Most public sector retirees get health plans until they turn 65, and then supplemental coverage on top of Medicare after that.

In most cases, state and local governments haven't prefunded these liabilities at all. As Americans age and health care costs rise, this is becoming a major drain on state and local finances, arguably more important than more-widely-discussed problems with public employee pensions.

But Obamacare will give states and cities a major out. Instead of providing health care to under-65 retirees, they can tell them to go buy health plans in the Obamacare exchanges. In many cases, those retirees will qualify for substantial subsidies to buy such plans. States and localities will often stand to save thousands of dollars per retiree per year, even if they provide a cash stipend to help each employee buy insurance in the exchange.

All told, state and local governments should be able to shift hundreds of billions of dollars in OPEB liabilities to the federal government. That will mean major savings for those governments. But it will also drive costs upward at the federal level.

Stressed local governments already making the shift

Detroit, as part of its bankruptcy plan, wants to stop providing health care to retirees and instead give them each a $125 monthly stipend to buy insurance in the exchange. Currently, Detroit spends $721 per month per retiree on health benefits, so this move will allow Detroit to cut its OPEB liability by 80%.

But it won't just be bankrupt cities like Detroit making the move. Chicago and Rhode Island — governments facing tight fiscal situations but not on the brink of bankruptcy — are considering similar shifts.

Unlike pensions, retiree health benefits are usually not legally guaranteed. Stressed cities and states will see kicking OPEB costs up to the federal government as a politically appealing option because of that legal flexibility.

Even in places where finances are flush, the shift will be tempting. Public employee unions that work together with state and local governments to switch to federal coverage will be playing a positive sum game: Existing benefits can be replaced with a combination of Obamacare coverage and cash that leaves retirees with more income and local governments with lower costs. Only federal taxpayers will get left holding the bag.

The numbers are big

Surprisingly, we don't know the total amount of state and local OPEB liabilities. My best back-of-the-envelope guess is that they are about $2 trillion. For comparison, total outstanding state and local bond debt is $3 trillion.

In 2012, the Pew Center on the States calculated that states have accrued $627 billion in unfunded OPEB. But most OPEB liabilities are at the local level, since most public employees work for local governments. There's no way to determine the total amount of local liabilities without examining financial statements on a county-by-county and town-by-town basis. Federal agencies like the Census Bureau and the Bureau of Economic Analysis don't do that for retiree health benefits.

The Empire Center for New York State Policy did a fairly comprehensive review in New York State last year, looking at the reported liabilities of the state's 89 largest local government employers and imputing liabilities for other, smaller governments. They estimated $177 billion in local liabilities, 2.5 times the $73 billion in liabilities accrued by the state government.

Applying a similar ratio nationally would imply just over $2 trillion in total OPEB liabilities. A 2007 research note from Credit Suisse put the figure at $1.5 trillion, but liabilities have grown significantly over the last six years.

How many of those liabilities can be shifted?

A substantial fraction. Consider the below example.

A retired public employee in New York City, age 60, is married to another 60-year-old, with $50,000 a year in retirement income. New York City's most common health plans would have cost about $12,500 per year for that couple in 2012, paid entirely by the city of New York. Given the current pace of medical inflation, such a plan will likely cost about $14,000 in 2014.

The default Obamacare exchange plan for that couple will be substantially cheaper — about $9,360, according to the Kaiser Family Foundation. But it gets better: The federal government will provide a subsidy of $4,610 to help that retired couple buy a health plan. Instead of $14,000, that retired couple can get exchange coverage at a cost of just $4,750 after federal subsidies.

Instead of directly providing a health plan, New York City could just give that couple cash to buy such a plan. Even if it adds $1,000 to cover added income taxes and $3,000 to compensate for the plan's reduced generosity, New York City will still come out ahead by about $5,000 a year, cutting the cost of insuring this retiree by more than a third.

What costs won't get shifted to the federal government?

States and cities won't be able to offload their entire OPEB liabilities, even if they move under-65 retirees into the Obamacare exchanges. Here are a few components that they'll still have to pay for:

Benefits for retirees over 65. Many state and local governments provide supplemental coverage on top of Medicare, including assistance with premiums for Medicare Parts B and D. These costs won't be greatly affected by Obamacare, though the enhancement of prescription drug benefits in Medicare Part D may reduce the cost of supplemental coverage that states and cities provide.

Many state and local governments provide supplemental coverage on top of Medicare, including assistance with premiums for Medicare Parts B and D. These costs won't be greatly affected by Obamacare, though the enhancement of prescription drug benefits in Medicare Part D may reduce the cost of supplemental coverage that states and cities provide. Dental, vision, and life insurance benefits. While OPEB liabilities consist mostly of medical benefit promises, they include any non-pension benefits that were promised to retirees. Non-medical benefits won't be affected.

While OPEB liabilities consist mostly of medical benefit promises, they include any non-pension benefits that were promised to retirees. Non-medical benefits won't be affected. Retiree contributions toward health premiums. As in the New York City example above, simply telling retirees "go buy in exchanges" would mean a marked reduction in their real income in retirement, because the retiree would be on the hook for several thousand dollars a year in premium contributions. Unless they're insolvent or close to insolvent, cities will generally feel pressed to make up this gap with cash payments that will eat up much of the savings from dropping retiree health plans — but not all of them.

As in the New York City example above, simply telling retirees "go buy in exchanges" would mean a marked reduction in their real income in retirement, because the retiree would be on the hook for several thousand dollars a year in premium contributions. Unless they're insolvent or close to insolvent, cities will generally feel pressed to make up this gap with cash payments that will eat up much of the savings from dropping retiree health plans — but not all of them. Retirees who aren't eligible for premium subsidies. If you make more than 400% of the federal poverty line (about $62,000 for a family of two) you aren't eligible for health plan premium subsidies under Obamacare. The cost of making these retirees whole might be so high that it eats up all the savings from switching to federal coverage.

What to do with the "windfall"

As some states and localities start switching retirees to federal coverage, the temptation is likely to spread. It's similar to the Medicaid expansion: Holdout states will have increasing difficulty justifying why they're not taking federal dollars that their neighbors are getting.

The question for cities and states will then be what to do with all the money they're saving. In Detroit, the answer is simple: The city doesn't have any money anyway. But in solvent jurisdictions, the temptation will be find new ways to spend money that lawmakers had been expecting to spend on retiree health care.

In general, the first choice should be to cut taxes. After all, new federal health benefits for retirees won't be free. They'll be an added in unexpected cost to the federal government, which will have to collect taxes over time to pay for them.

But very often, I expect that state and local officials will find other ways to spend the money.

Bill de Blasio, New York's Democratic nominee for mayor, wants a new pre-Kindergarten program that he estimates will cost $350 million a year. He wants to pay for it with a high-income tax increase that state lawmakers aren't likely to approve. His Republican opponent, Joe Lhota, says he also favors universal pre-K but wants to find a different funding mechanism.

Meanwhile, in the next mayor's first year in office, New York City will spend $2.3 billion on health benefits for retirees. Cutting a deal with unions to shift many of those costs up to the federal government would produce enough savings to pay for universal pre-K, and then some. Watch for the next mayor to do so, whomever it is.