October 17.

Mark that day on your calendar. According to Treasury Secretary Jack Lew, that's when -- give or take a few days -- the U.S. government could effectively run out of cash and be unable to pay the nation's bills, potentially defaulting on our debt for the first time in history.

Why?

In May, the government hit the debt ceiling, which prevents it from borrowing  more money. We've been able to keep the lights on until now because Fannie Mae and Freddie Mac repaid a huge portion of their 2008 bailout funds, and the Treasury juggled around money in intra-government pension funds to stretch out our cash. But after Oct. 17, the game is up. 

The odds are still overwhelming that Congress will raise the debt ceiling to avoid default. This is the third time we've done this political dance in as many years. But this showdown looks especially precarious -- neither party shows any sign of giving in. "Make no mistake," Potomac Research Group wrote this week, "this will become a genuine crisis, far more ominous than the threat of a government shut-down." 

Questions? Let me see if I can help. 

What is the debt ceiling?
It's a self-imposed limit on how much the nation can borrow.

Here's how it came about.

Before 1917, Congress had to approve each new debt issuance. If it needed to borrow money for a specific project, it had to pass new legislation deciding on the bond's maturity date and interest rate.

This became too burdensome once World War I hit. Congress slowly loosened the rules on individual debt issuances before removing them entirely in 1939. Still, it didn't want to make borrowing open-ended. So Congress basically told the Treasury, "You can borrow this much money. Go figure out the best way to do it." This "gave the Treasury freer rein to manage the federal debt as it saw fit ... with maturities that would reduce interest costs and minimize financial risks stemming from future interest rate changes," according to the Congressional Research Service.

Once we hit the debt ceiling, Congress goes back and raises it again. Rinse, repeat.

What's the purpose of a debt ceiling if we raise it every time we hit it?
Many political scientists, economists, and budget analysts have asked that question. Most seem to come to the same conclusion: It's pointless. There's a theory that the debt ceiling can be used as a "precommitment device," or a tool that prevents us from doing something bad in the future. But since it can be lifted at any time, it doesn't do much besides boosting C-SPAN's ratings a few times per year. 

Doesn't it control spending?
Not really. 

It can be used as a bargaining chip, but the debt ceiling has no direct link to the normal annual budgeting process. Budgets are passed nearly every year that will require borrowing in excess of the debt ceiling limit. When Congress authorizes these budgets, there's an implicit assumption that they'll also raise the debt ceiling. 

The need to raise the debt ceiling isn't so much about controlling future spending as it is paying for spending Congress has already agreed to. Two budget votes take place in Washington: one to decide how much to spend (the budget) and another down the road to decide whether we want to pay for that committed spending (the debt ceiling).  

What other countries use a debt ceiling?
Denmark. No one else. And Danes are practical about it. They've only had to raise their debt ceiling once since the early 1990s, and politicians nearly doubled it so the issue won't pop up again soon. 

How often has America's debt ceiling been raised?
Since 1940, 99 times -- or an average of every nine months. Here's how many times the debt ceiling has been raised under each president since 1940:

President

Number of Times
Debt Ceiling Was Raised

Roosevelt (1933 -1945)

6

Truman (1945 -1953)

2

Eisenhower (1953-1961)

8

Kennedy (1961-1963)

5

Johnson (1963-1969)

8

Nixon (1969-1974)

9

Ford (1974-1977)

6

Carter (1977-1981)

9

Reagan (1981-1989)

18

GHW Bush (1989-1993)

9

Clinton (1993-2000)

6

GW Bush (2000-2009)

7

Obama (2009-present)

6

Source: Office of Budget and Management. 

What happens if we don't raise the debt ceiling by Oct. 17?
The government won't be able to pay all its bills. Everything from Social Security payments to soldiers to park rangers to interest on the national debt.

The government still takes in a lot of tax revenue -- about $2.7 trillion this year. That could pay some (even most) bills. But deciding who gets paid and who gets stiffed is tricky, both legally and logistically. 

One idea is that the Treasury can prioritize payments on things like soldier pay and interest on the debt. But the Treasury says it's not equipped to do that. It processes several hundred million checks each year, and its computer system isn't set up to pay in any other order than first come, first served. The Inspector General said as much last month:

While Congress enacted these expenditures, it did not prioritize them, nor did it direct the President or the Treasury to pay some expenses and not pay others. As a result, Treasury officials determined that there is no fair or sensible way to pick and choose among the many bills that come due every day. Furthermore, because Congress has never provided guidance to the contrary, Treasury's systems are designed to make each payment in the order it comes due.

Some legal scholars also say that if one person (say, a government vendor) isn't paid so that someone else (say, a Medicare recipient) can be made whole, the vendor could sue the government for unlawfully prioritizing. That brings up a whole new set of problems. 

And while the Treasury takes in a lot of tax revenue during the year, it's not like a worker's stable paycheck that arrives in equal amounts every other Friday. It's lumpy. Check out the Treasury's daily cash-flow statements. On Tuesday of this week, it took in $11.6 billion of tax revenue. On Sept. 3, it took in $127 billion. On Aug. 19, it brought in $4.1 billion. In February, it took in $122 billion. In April, $406 billion. 

When payments are lumpy and the Treasury is unable to borrow, a point will eventually be reached where we'll have, say, a $50 billion interest payment due but only $10 billion of tax revenue coming in the door that day. Short-term cash-flow problems, not total annual revenue, are what make a debt default unavoidable without raising the debt ceiling. (It's also why the government still borrows from time to time when it's running a surplus.) This is exactly the situation we faced during the debt-ceiling showdown earlier this year.

Does not raising the debt ceiling make us bankrupt?
Bankrupt, no. Deadbeat, yes. America can pay its bills. Whether it has the will to do so is another story.

What should I do with my investments?
Probably nothing. There is never a good time to panic. If you were comfortable with your investments last month, you should be comfortable with them next month. However hairy this gets, we'll get through it. Turn off the TV, and take the long view.

Check back every Tuesday and Friday for Morgan Housel's columns on finance and economics.

More on the economy
For more about how the nation handles its debt, check out our report, "Everything You Need to Know About the National Debt." It walks you through with step-by-step explanations about how the government spends your money, where it gets tax revenue from, the future of spending, and what a $16 trillion debt means for our future. Click here to read it. 

Follow Morgan Housel on Twitter @TMFHousel. The Motley Fool has a disclosure policy.