Illinois is in critical financial condition: The state has $15 billion of unpaid bills. Legislators have failed to pass a budget in the past two years. Recently, S&P Global threatened to make history by downgrading the state's debt to "junk," in what would be a first-ever event for any U.S. state.

Things are so bad that a reliable source of state revenue -- lottery ticket sales -- may cease if the legislature does not pass a budget by July 1. The Illinois Lottery won't be able to pay anyone who wins a prize larger than $25,000 unless a budget is passed. Previously, the state famously paid large lottery winners in IOUs, as it redirected cash receipts from lotteries to make up for other shortfalls.

Map of the United States

Image source: Getty Images.

It's really remarkable. The $15 billion of unpaid bills are just the tip of the iceberg. The state has more than a quarter-trillion of pension liabilities owed to state employees. The problem is only compounding, as residents are leaving, fearing that taxes will go up to solve its budget gap. Illinois was the only Midwestern state to lose residents last year.

Scoring states' finances

One quick and dirty way to measure a state's financial condition is to look at its credit rating. Bond rating agencies ascribe letter grades to a state's general obligation bonds, or bonds that are backed by the state's budget and its ability to tax.

The best rating, AAA, is reserved for only a handful of states. Next is AA, which is the rating that S&P gives most states. Below AA is the A rating. The worst rating, so far, is Illinois' BBB rating, which sits just one step above "junk," which begins at BB.

These ratings provide a qualitative score for a state's ability to repay what it borrows. Bond ratings affect how much states pay in interest when they borrow, just as your personal credit score affects the rate you'll pay on a mortgage.

Lower ratings can create a downward spiral, as low-rated states have to send more cash out the door to appease creditors while paying higher rates when debt is refinanced. S&P's credit analyst wrote that he believes "that Illinois is now at risk of entering a negative credit spiral, where downgraded credit ratings would trigger contingent demands on state liquidity, further exacerbating its fiscal distress."

How your state compares

The chart below shows credit ratings assigned by S&P to most states' general obligation bonds. Some (those in gray) do not have a credit rating to show, either because they are not rated by S&P, or because they don't have any general obligation bonds outstanding.

Map of US State Credit Ratings

Data sources: Bloomberg, S&P. Image by author. The map was created with CreateAClickableMap.com

The majority of states score highly, with AAA and AA credit ratings. But three -- Illinois, New Jersey, and Connecticut -- stand out for particularly low credit ratings in contrast to other states.

Fixing budget gaps

While Illinois' problems are well-publicized, other states face smaller, but similar, fiscal issues of their own. Take Connecticut, for instance, which has been hard-hit as businesses and wealthy individuals leave the state. The state has a high per capita concentration of hedge fund managers and wealthy financiers. More than a third of its tax receipts come from the top 1% of earners, who have more reason to seek out lower-taxed states to call home.

When the wealthiest residents pack their bags, a whole state can suffer. Just ask New Jersey. Billionaire hedge fund manager David Tepper recently moved himself and his company from the state to Florida, one of seven states that does not have an income tax. The news forced New Jersey to go back to the drawing board to re-evaluate its expected tax revenue. The New York Times wrote that "[t]ax experts say his move to Florida could cost New Jersey -- which has a top tax rate of 8.97 percent -- hundreds of millions of dollars in lost payments."

The truth is that the ultra-wealthy have more flexibility than the average worker to pack up and move, making it difficult for states to fix budget gaps by raising taxes on income and capital gains. As tax rates increase, the incentive for the wealthiest residents to pack up and move only grows, creating a downward spiral in tax revenue.

Businesses move, too. In an economy that is no longer driven by manufacturing or agriculture, but is centered on services, it's easier than ever for large businesses to find new homes. Hartford, Connecticut, a city that has long been home to many of the country's largest insurance companies, is losing insurance headquarters to other states. Aetna, the city's fourth-largest taxpayer, was the latest insurer to announce it would move its corporate headquarters.

Where you live matters

Perhaps the most important takeaway is that where you live really matters. A state's budget isn't just fodder for headlines, and fiscal problems can affect more than just your personal income taxes.

In a modern economy that produces far more services than physical products, a state's financial health can affect whether or not employers -- and high-paying jobs -- come to your state, which trickles down and has lasting effects on everything from housing prices to the quality of local school systems.

The decision on where to live isn't just about a place to call home; it's a bet on the capability of local lawmakers to design a system that creates prosperity for all who live there.

Jordan Wathen has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.