States are doing great, at least when compared with America's cities.
The credit rating of the states' sector was recently upgraded to stable by Moody's Investor Service—a significant change that coincided with the five-year anniversary of the financial crisis. Through June, the states had reported 14 straight quarters of revenue growth, with most states passing their precrisis revenue peak.
But even with a strengthening economy and growing tax base, the outlook for U.S. cities and towns remains mixed. One lingering lesson of the crisis is that when an economy collapses, a state can dump its problems on local governments.
For every Detroit or San Bernadino, Calif., there are towns and cities nationwide with less severe problems but a significant gap in relation to the state recovery.
"Higher levels of government push their problems down to the lower levels," said Bob Kurtter, managing director of U.S. public finance at Moody's. The process is referred to as "downloading" by some public finance experts.
Conversely, cost-cutting by states is made easier by the fact that they can get federal aid and stimulus dollars in areas including health care and transportation.
"States got through the recession in pretty good shape and now find themselves in a better position," Kurtter said.
(Read more: The senior franchise boom)
Laura Porter, managing director at Fitch, said the first thing states do in a downturn is to look to reserves and higher education, and then cut or freeze Medicaid spending and "download" to local governments, which focuses on K-12 education.
"It's easy for them to cut, versus a local government, which actually provides services," she said.
While shaving funds for K-12 is more politically sensitive than cutting money for higher education, state-level cuts to K-12 were more common in the recent downturn than they have been historically.
"States directly cut funding or scaled back the rate of growth and the local municipalities had to deal with the problems. That's downloading," Porter said.
The recovery of states tracks that of the larger economy. They are benefiting from growing sales and income tax receipts, high-earner income tax payments triggered by stock market gains and a one-time revenue boost caused by tax law changes effective in 2012 that accelerated payments from wealthy individuals.
Sales taxes also reflect the general economy and increased consumer confidence, including the rebound in auto sales, which is a big source of state sales tax revenue. And income tax has added significantly to state revenue since the recession.
Income tax accounts for 40 percent of state revenue in California—one of the 10 largest economies in the world, with total revenue of roughly $100 billion—and in the past two decades has risen as a percentage of the state's overall revenue by 25 percent.
For example, Kurtter said, "when Facebook went public, the impact of early employees exercising options had a measurable impact on California revenue collection, and that's for a state of 36 million people."
(Read more: That police officer ... is a robot?)