The US has grown itself too much sugar. It has done so for years—and yet cane and beet farmers produced record amounts of sugar again this year, says the US Department of Agriculture (USDA).

If this were a free market that would be terrible news for the US’s 5,000 or so beet and cane growers. But it’s not. In fact, the USDA just agreed to spend $38 million on buying sugar in order to prop up the prices. That’s adding a tax bill to a sugar aid program that already costs US consumers $3.5 billion each year, according to research by Iowa State University.

Grasping why the government is doing this reveals a complicated—some would say insane—lattice of price controls, import quotas and government lending to prop up both sugar growers and sugar refiners. Here’s how it works.

The argument made for sugar aid is that at market prices, US sugar refiners wouldn’t buy from US farmers, because lower foreign labor costs make imported sugar so much cheaper—and that’s even with import tariffs. But the government doesn’t subsidize sugarcane and beet farmers, the way it does with grains. Instead it sets an artificially high price for raw sugar. It then loans money to sugar refiners to buy the sugar from US growers at that price.

The sugar they refine acts as their collateral for the loan from the government. The refiners can either repay the loan with interest after selling the refined sugar, or “forfeit”—meaning that they give the USDA a heaping pile of collateralized refined sugar. That’s not a “forfeiture” in the sense we usually think of it, though. It just means that if a refiner can’t get a higher price in the market, it can give the sugar back to the government, taking a bath on refining costs but not much else.

At the same time, the US government restricts sugar imports using tariffs; if it didn’t, imported sugar would undercut the USDA-set market price. But then these limits on imports apparently make life too difficult for sugar refiners. So they are issued “import credits”, which are licenses to import some foreign raw sugar as long as they export an equivalent amount of refined sugar.

But now, with production at an all-time high and raw sugar flooding the market, prices have been driven below the government-set threshold and refiners are struggling to find buyers who will pay more than the government loaned them. That means forfeitures—an estimated $700 million worth, in fact.

Since the forfeiture scheme has seldom been tested, it’s not clear what exactly the government would do with all that sugar. The Wall Street Journal notes that the last time this happened, in 2000, it donated the stuff to prisons and assisted-living facilities (paywall). New laws require it to sell the sugar to ethanol manufacturers—but no one’s sure how that would work.

Instead, the government has gone for a cheaper option. It will give farmers $38 million for raw sugar, and then sell it to refiners. The refiners won’t pay the government in cash, however, but in import credits. Confused? Never mind: the point is that this will have the effect of reducing imports and thus tightening US sugar supply. The plan will mop up about 300,000 tons (272,000 tonnes) of sweet stuff from the US market, says the USDA.

Part of the reason that the USDA’s knotty sugar scheme has been allowed to go on for so long is probably that it’s not a subsidy in the conventional sense, so it’s thought to cost taxpayers nothing. And strictly speaking, that’s true. But while keeping prices artificially high doesn’t hurt taxpayers, it does hurt consumers—who are, of course, to a large extent the same people. American sweet-tooths coughed up nearly $0.70 per pound for sugar in the last fiscal year; global consumers paid around $0.28 per pound.

Put another way, US taxpayers will end up paying $38 million to protect a system that already charges them an extra $3.5 billion a year. Talk about salting the wound.