Gov. Tim Walz and legislative leaders scored an invitation to the White House last month to talk about the money they decided to spend over the next two years.

The rest of us are still trying to add it up.

All spring, so much was happening at the Legislature that I started to feel that most people — the public, media and lobbyists for sure, but even many lawmakers — were missing the forest because they were so focused on the trees.

In the month and a half since the legislative session ended, it's become clear that Walz and Democrats boosted the size of Minnesota's state government in a way none of us have ever seen before.

"It was arguably a transformation of state government greater in scale and scope than anything else in Minnesota history," Mark Haveman, executive director of the Minnesota Center for Fiscal Excellence, the tax watchdog group in St. Paul, wrote in an article summarizing the session.

I think he could have dropped the "arguably."

He went back to the revenue and spending numbers of the "Minnesota Miracle" legislative session, the one in 1971 to which Walz and other Democrats repeatedly compared this year's work.

In inflation-adjusted dollars, the 1971 lawmakers raised the state's per capita spending by $1,475. This year's lawmakers raised the state's per capita spending by $3,036, Haveman wrote.

Around one-third of the latest increase was designed by lawmakers as one-time spending. But in Minnesota's and many governments, one-time spending hikes have a way of becoming permanent.

The question that puzzled me was: Where did the state get all this money?

The easy answer is Minnesotans earned it. The state's income tax collection, which accounts for half of its revenue, grew 22% during the last two years. That was four times greater than expected.

To be sure, some sound financial management also helped. During the Mark Dayton years and start of the Walz administration, Minnesota's government annually spent a little less than its revenue, creating little surpluses that accumulated.

And it turned out the quick, pandemic-related recession in 2020 did little damage to the state's finances. It had a $1.5 billion surplus heading into the fiscal 2022-23 biennium that began July 2021 and ended last month.

Lawmakers in 2021 crafted a budget around the expectation that the state's revenue would be $50 billion during the biennium.

But a surprise happened. The state's revenue turned out to be $61 billion instead.

While tax rates stayed the same, the revenue rose because Minnesotans' income did. And most of that was nonwage income, which people get from selling investments or businesses.

When you file your state taxes, you are not required to show sources of your nonwage income. So the state doesn't precisely know where the money came from, Minnesota State Economist Laura Kalambokidis told me.

But it's easy to guess. The stock market had amazing years in 2020 and 2021. The S&P 500 gained 17% in 2020, which would have boosted the state's income tax collection in 2021. It leapt another 27% in 2021, which would have boosted last year's tax collection.

"It wasn't a Minnesota-specific phenomenon. Every state that has an income tax saw that in those years," Kalambokidis said.

Capital gains are obviously volatile. Last year, stock market values fell, which is part of the reason that Kalambokidis and her colleagues forecast flat revenue for state government this year.

But equally as striking, the budget forecasters didn't shift revenue expectations for 2024-25 back to where they were two years ago.

That's in part because Minnesota's corporate tax collection helped create a new, higher revenue floor. "The corporate tax forecast behaves more like when the base goes up, we go off of that new base. It's a little more straightforward than the income tax," Kalambokidis said.

And in setting the budget for the next two years, lawmakers were careful not to cut revenue. They held it flat at $61 billion. That's why they created some new taxes while giving back $3 billion of the $17 billion surplus in rebates to some Minnesotans.

Spending will be closer to $70 billion for the next two years, but it's being covered by the surplus.

The state budget office's forecast in February accounted for a mild recession in 2023. That hasn't happened yet. And the S&P 500's total return is 17% so far this year, which should be pushing the nonwage income of Minnesotans upward again.

That could mean higher-than-expected revenue for the state this year, leading to possibly another surplus that some lawmakers will see as fuel for more spending.

We'll know more in October, when the state budget office closes the books on the just-finished biennium, and November, when its next major outlook is published.