In the past decade and a half since 1998, central banks have nearly continously manipulated markets and economies. Trailing price/earnings ratios have remained historically high even after frequent bear market crashes, and stocks are now seen primarily as speculative short term holdings rather than long term investments.
Traditionally, stocks were regarded as the basis of long term wealth building since corporate earnings rose inexorably in tandem with nominal GDP growth. The inherent belief was, and largely still is amongst credit lovers and gold haters, that stock prices rise more than inflation and are therefore inflation hedges. All an investor need do is to start buying stocks by age 25 and keep buying to make a pot of wealth which is safe from inflation. Stocks adjusted for inflation have nonetheless lost value since 1998-2000 (sector dependent), but that is dismissed with remarks that a bad decade is to be expected once in a while. It is indisputable, however, that commodities and gold and much real estate have greatly outperformed inflation and stocks in the same environment.
Stephane Deo of Union Bank of Switzerland has analyzed inflationary regime switches and whether and how much equities hedge inflation as it waxes or wanes. Deo found that equities hedge inflation quite well from just over 2% inflation periods up to nearly 5% inflation periods, but as inflation increases further, the inflation hedging power of equities falls off greatly, disappearing at about 6.5%. By 9.5% there is no longer any price increase even in nominal terms.
If one believes that inflation will increase over the next few years, this would be a good time to be exposed to stocks to hedge that inflation. Note, however, that if inflation falls below 2% (currently ~2.2%), prices of stocks would likely fall under very mild inflation and go negative at about +1.7% and below.This was true on a trend basis from about 1929-1942 in the US and since 1990 in Japan
The relationship of earnings and inflation is at the heart of Kondratieff Wave analysis. Under my wave analysis, stocks go up in mild deflation when interest rates are falling gradually from high levels (1982-2000), and stocks go up in mild inflation when interest rates are stable or rising slowly (1949-1965/72). But at "some point", which historically I personally judged to be ~6%, rates become "too high", and stocks stall out. Deo's 6.5% maximum hedge cutoff is pretty close to my own guess level, although the cutoff could happen earlier (at a lower rate) if velocity (or acceleration!) of inflation is "too high".
Bear in mind that another risk is that at very high levels of inflation stocks may not keep up with inflation but can still rise and attract money which is fleeing the economy and local currency in any way it can.