Editor’s note: This is an updated version of a story first published in 2011.

There’s a fight looming at the Texas Legislature: how to balance the state budget for the next two years.

The Texas House’s version of the budget pulls $2.5 billion from the state’s savings account, also known as the Economic Stabilization Fund, or Rainy Day, Fund. Right now, there’s more than $10 billion in that reserve.

The Senate, though, says it doesn’t want to pull out any of that money.

But before that debate heats up, we got to wondering how all that money got there in the first place.

First, Rainy Day Fund 101:

“It’s basically set up to keep the bumps out of what’s normally a bumpy economy,” says Ross Ramsey, executive editor at the Texas Tribune.

So where does the money come from? Ramsey says it’s kind of like an automatic deduction from your paycheck — if your paycheck was state revenue.

“So that while you were employed, a dime from every dollar or something like that went into your savings account and you didn’t even think about it,” Ramsey says. “And that money built up and you had sort of an agreement with yourself not to use it unless you lost your job or something you know financially tragic happened in your life.”

So that’s the fund in a nutshell. It’s money the state has already earned, but smartly socked away for a rainy day. So how and why did lawmakers come up with this system in the first place?

It all goes back to the late 1970s. Thanks to the Iranian revolution—and a few other factors—oil prices hit record highs in 1979. That meant record oil and natural gas tax collections for the State of Texas. And the state spent that windfall.

But a couple years later, oil prices collapsed.

That left the state budget in kind of a predicament. Kind of like now, lawmakers didn’t have the money to continue paying for services. Oil prices did eventually go up again, and by 1987 there was this one guy who learned a lesson from the collapse. This one guy who thought, maybe – maybe – we could protect ourselves from future economic shocks.

That guy was state Rep. Stan Schlueter. He had the notion that you could take some of the tax money you collect in good times, and use it during bad times.

Schlueter’s plan would use the amount of oil and natural gas tax collections in 1987 as kind of a benchmark. In future years, anything the state collected above that 1987 amount would get split two ways: lawmakers could use 25 percent of it right away and the rest of it would go into the Rainy Day Fund.

Billy Hamilton, a former state finance official and current Chief Financial Officer of the Texas A&M University System, says the Rainy Day Fund wasn’t just designed as a savings account. It was also designed to be a check on spending. You put the extra money into a savings account, so you can’t run out and buy a big screen TV and a yacht in the good times.

“I think [Schlueter] knew what he was trying to achieve,” Hamilton says. “I mean it really is a very clear idea.”

Now, whether or not this is a rainy day, is up to state lawmakers. But just like the 1980s, maybe the state’s current fiscal problems will lead to new solutions in the future.