I think you meant "earnings" when you typed "dividends" - they're quite different - but regardless, understanding what P/E is reported makes this all a bit clearer.
Most quote services, and most "index P/Es" that you see reported, are based on the trailing twelve months of reported earnings ("TTM"). The P/E is looking in the rear view mirror. In say early-mid 2008 the trailing P/E for a broad-market stock index might still have included in its earnings the past income of soon-to-be-defunct-or-acquired companies like Lehman, AIG, Fannie Mae, WaMu, Countrywide, Merrill Lynch and on and on. Earnings were clearly contracting but the "E" that was the basis for the market P/E hadn't yet adjusted, because it hadn't hit the next reporting quarter yet.
So it makes perfect sense that P/Es will rise and fall over time. Price is responding to the expectations for what earnings are going to be in the future. I'd add the nuance that inflation is a factor here too, because that affects the price you'd pay for earnings ($1 a share next year is worth less to you if inflation is 100% per year - so would demand a lower P/E).
But anyway - if the market is doing a good job of predicting the future, P/Es should be below-average when earnings are about to drop (or "not grow much"), and should be above-average when earnings are about to rise, simply because of the P/E that's reported (TTM). Only if earnings were always stable should P/E be stable, or perhaps stable when you adjust everything for inflation. And earnings are never stable!
You can find examples where the market is right about individual stocks
- P/Es of 2, 3, 5 right before bankruptcies or big declines in earnings. Of course you can also find examples going very strongly the other way, which gets at the argument that "value" - whether expressed as a low P/E, a low price relative to book value, or a high dividend yield - is just signaling some type of risk, and risk and reward should be related.
-Tad