A company's stock price is based in part on the
expectation of future results, not future growth.
The extent to which that expectation tilts toward wanting/demanding growth, varies from one stock to the next. Some companies do not trade with a heavy tilt toward the requirement for growth. Others do, and if a company misses on that growth expectation, the stock will plunge. Whereas other companies go without growth for years and maintain a relatively high PE ratio.
If this were not the case, any company with zero growth or a contracting business would be treated as worthless - or otherwise granted an extreme discount - by the market.
McDonald's saw contraction in its business for years, the market still saw fit to routinely grant it a 20+ PE ratio while they shrank. Coca Cola has been in a similar scenario, they've had horrible business performance for years, yet they have a 30+ multiple. Boeing is getting its corporate brains pounded in right now, in every possible regard financially, and yet the stock is very high (and their multiple is about to be astronomical). There is zero expectation for growth in the near future for Boeing.
So what's the basis of Coca Cola's valuation if it isn't growth year to year? Well, all sorts of things enter the picture depending on the stock. KO pays a dividend. KO has an extremely valuable and enduring brand. KO appeals to conservative investors who feel safe owning it (in a world in which ~$13 trillion in debt is trading at negative yields). KO gets put into all sorts of conservative investment vehicles, that helps prop up the stock. KO has a very large international business, so it gets an investor exposure outside of the US; some investors like that (even if doesn't make a lot of sense as a good investment argument in this case; investors are often not rational). KO buys back their own stock, which props things up a bit. KO has maintained fat margins even as their top line has contracted, investors surely like the overall profitability. KO has large, long-term owners, such as Buffett / Berkshire Hathaway, which lends confidence. And no doubt there is also a segment of investors that think KO may one day return to growth again (even if there hasn't been evidence to support that premise for many years), or otherwise make moves to expand the business (eg by acquiring Monster). Most of the arguments and cause for KO at a 30+ PE ratio, have nothing to do with expectations for growth, however.
Apple could go years without growth, and still maintain a surprisingly high PE ratio, a 15-20 multiple for example. You could see them go without growth for many years and the stock merely goes sideways, while the expectation for growth entirely disappears (if stocks were all heavily priced based on future expectations for growth, Apple would have already fallen off a cliff, as nobody expects much growth for AAPL going forward; investors are at best hoping they can replace falling iPhone revenue with service revenue over time). Or maybe the market sours on their performance, they fall out of favor, and they go back to having a ~10 PE ratio as they did in the not so distant past. Plenty of this stuff is emotional (a stock getting tagged in the financial & business press with a negative growth story that dogs it for years) or momentum-based, it often makes no logical sense.
Not that long ago Facebook had a 20 PE, while actually still producing healthy growth. Meanwhile over there is Coca Cola with zero growth for years, zero expectation for growth, and getting granted a higher PE ratio (KO also arguably has an even worse negative story re sugar). That's an example of comical irrationality in charge and FB getting tagged with a negative, emotion-heavy story in all the business press. Then 'magically' it fades, the extreme negative emotionalism fades from the business press, and FB's multiple expands. This is the aspect of human nature that in part led Ben Graham to his statement about the market being a voting machine short-term (emotional heavy; reactionary; did the quarterly results surprise, miss, beat, et al.), and a weighing machine long-term (what is the enduring value of the Coca Cola company, what are its assets, how much is their business really worth, will that persist for many years to come, what will their cash flow look like over the next five or ten years, etc).