It's likely been a frustrating year for a lot of investors. Many tech stocks have been hammered, from megacaps like Meta Platforms (META 2.48%) and to work-from-home growth stock darlings like Zoom Video Communications and Peloton Interactive. Very few industries have avoided the market's whacking, with retail, real estate, and financials receiving beatdowns this year as well. Picking stocks lately hasn't been easy, to say the least.

But a lesson can be learned from two stocks that are beating the market this year by a significant margin -- and both stocks are in very different industries from each other. Those two stocks are none other than the boring and decades-old Waste Management (WM 0.07%) and McDonald's (MCD -0.53%). While the S&P 500 index has fallen about 17% year to date, Waste Management stock is down just 5% and McDonald's shares are up 2% as of this writing. The two stocks are outperformers on both five- and 10-year time horizons as well. While there are many reasons for the market's bullishness for these two companies' shares, both have one thing in common: Their businesses are unlikely to be derailed or disrupted by weak macroeconomic environments or new competition.

Predictable businesses deserve high valuations

If there's anything 2022 has taught us, it's that the market's appetite for a stock can decrease quickly if a company's future becomes less certain. Consider the sharp fall of Meta Platforms, the parent company of Facebook, Instagram, and WhatsApp this year. Shares are likely down due to year-to-date earnings per share declining nearly 33% compared to the same period last year. Meta is grappling with a combination of reduced advertiser budgets amid macroeconomic uncertainty and the impact of changes to ad tracking and ad measurement in Apple's mobile operating system. Such a sharp drop in earnings has investors reassessing the company's long-term earnings growth potential and the likelihood of various scenarios playing out.

It's on this point of predictability that McDonald's and Waste Management stand out. Not only does it stand to reason that the world's largest fast-food burger chain and the country's biggest waste management service will still likely be serving customers 10, 20, or even 30 years from now, but the two companies also have a long history of steady growth to prove their staying power. McDonald's was founded in 1955 and Waste Management was founded in 1968. Compare this to Meta Platforms' short history of less than 20 years. Even more, Meta didn't even go public until 2012; this means the company didn't have to survive the dot-com bubble and wasn't even publicly traded during the Great Recession.

All of this is to say that the sudden disruption to revenue and earnings for some tech darlings in 2022 is a stark reminder that it's paramount for companies to prove to investors that they can grow steadily for years to come if they want their stocks to command high valuations in the market. Waste Management and McDonald's have done this for decades, and they continued to do this during COVID-19 shutdowns in 2020 and 2021, and the inflationary environment today. Even in the third quarter of 2022, McDonald's and Waste Management revenues outperformed analyst expectations.

Growing dividends

The strength of both companies, even during difficult times, is also evident by their long history of consistent dividend growth. McDonald's has raised its dividend for 45 consecutive years, with its most recent increase of 10% announced last month. Waste Management's most recent dividend increase occurred last December, when it raised its dividend by 13%. This marks the company's 19th year in a row of dividend increases.

While growing dividends are not enough reason for a stock to command a premium valuation, even during challenging times, they do suggest a company is likely doing something right. In McDonald's and Waste Management's cases, their many years of dividend growth reflect resilient businesses growing steadily through all environments. These two companies' consistent growth and the market's appreciation for their difficult-to-disrupt businesses are likely some of the key factors the two stocks have been significant outperformers in 2022.