The stock market has hit record highs and public pension funds are reporting record levels of capital, yet public pension costs keep growing, leaving some observers puzzled. A new book by French economist Thomas Piketty helps clear up the confusion.

In his book, Capital in the 21st Century, Piketty explains that capital is wealth derived from past activities (e.g., your savings represent wealth you accumulated over the past) that combines with labor to produce, and split the benefits from, economic growth. Everything works fine so long as returns promised to capital are lower than economic growth rates. But when returns promised to capital are higher than economic growth rates, Piketty says the past “devours the future.”

That’s what’s happening with public pension costs. When elected officials promise pensions to public employees they create capital (assets for employees, liabilities for governments) requiring a high rate of return that forces governments to divert spending from current activities. Here’s how it works:

As pensions are promised, the employees who will receive the pensions and the governments that promised the pension make upfront contributions into a trust fund (a public pension fund) that invests that capital in the hope that earnings on those contributions will grow sufficiently to make the future payments. The size of the upfront contribution is a function of the rate of return the parties expect the fund to earn on capital (the “expected return”). The higher the expected return, the lower the upfront contribution, and vice versa. Everything works fine if the actual return equals the expected return, but if the actual return falls short of the expected return, governments have to make up the difference. (Employees don’t have to share in the cost of deficiencies because they are promised their pensions regardless of investment performance.) When that happens, governments have to shift spending from services, raise taxes, or both.

In other words, public pension funds must earn the expected return or governments have to divert money from other activities to cover the deficiency. Historically, according to Piketty, capital tends to expect a return of 4.5-5% per annum. That’s tough enough when GDP growth doesn’t reach those levels, but governments like California base upfront contributions on an even higher rate of return, usually 7.5-8% per annum. That’s why public pension costs are rising.

For example, even though the pension assets managed by the California Public Employee Retirement System (CalPERS) earned an enviable 7.1% per annum over the ten years through 2013, pension costs for California governments were billions of dollars more than expected. California governments would have had to spend much less on pension deficiencies had upfront contributions reflected a lower expected rate of return. That outcome is simply a consequence of Piketty’s principle that a high rate of return to capital reduces money available for other activities.

Another consequence is that, once public pension assets fall behind pension liabilities, it’s virtually impossible to catch up if a high expected rate of return was employed to set upfront contributions. For example, even though the stock market is up more than 100% since 2009 and CalPERS has averaged extraordinary annual returns of 14% since then, the unfunded pension liability (i.e., the deficit when pension liabilities exceed pension assets) owed by California governments has improved (declined) only 30%. Even now, five years into a great bull market, CalPERS needs to earn double-digit annual returns just to keep the unfunded liability from growing.

These outcomes are not due to investment lapses by CalPERS, which is extremely good at its job of managing pension assets, or to the Great Recession, but rather to math. In fact, as Warren Buffett has explained, governments were way behind on their pension promises even before the Great Recession. That’s because the expected rate of return employed by governments like California in setting upfront pension contributions implicitly forecast the Dow Jones Industrial Average (DJIA) to reach 20,000 before the Great Recession, but even at its peak before the 2008 financial crisis, the DJIA reached only 14,000. Today, the DJIA would have to be over 30,000 to have provided the expected rate of return. With the DJIA just now reaching a record 17,000, the difference must come from governments. That means more cuts to services, higher taxes or both.

Public employees did not cause this problem. Politicians making promises requiring high rates of return caused it. Meeting that rate of return will continue devouring the future. Citizens must plan accordingly.

David G. Crane, a lecturer at Stanford University, is president of Govern for California.