The stock market hasn't been in the best of health so far in 2022 with the S&P 500 index down 5%, but the correction has created an opportunity for investors to add some solid stocks to their portfolios at attractive valuations.

Apple (AAPL 0.09%) and Intel (INTC -0.83%) are two stocks investors can consider investing $5,000 in for the next five years as they are on track to take advantage of some secular growth opportunities. Let's look at the reasons why these tech giants could make investors richer in the long run.

A person looks at a chart on a laptop.

Image source: Getty Images.

1. Apple

A $5,000 investment in Apple at the beginning of 2017 was worth nearly $30,000 at the end of 2021 thanks to the stock's terrific rise during this five-year period.

AAPL Chart

AAPL data by YCharts

But the stock market sell-off has led to a 5% decline in shares of Apple so far this year. However, Apple seems capable of delivering outstanding stock market returns over the next five years as well due to a few reasons.

First, the company is leading the fast-growing 5G smartphone market. Strategy Analytics estimates that Apple accounted for 31% of global 5G smartphone shipments in 2021. It is worth noting that Apple's 5G smartphone shipments last year exceeded the combined shipments of the next two vendors.

Apple's dominant position in the 5G smartphone market could be a solid long-term catalyst for the company. That's because global 5G mobile subscriptions are expected to jump from 664 million in 2021 to nearly 4.4 billion by 2027, according to third-party estimates. Apple appears to be pulling the right strings to make the most of this lucrative opportunity by adding an entry-level 5G-enabled iPhone to its portfolio that could substantially boost the company's smartphone shipments.

Second, Apple is reportedly working on new products such as self-driving cars, and metaverse-related hardware such as mixed reality headsets. Bloomberg reported in November 2021 that Apple aims to launch a self-driving electric car by 2025, compared to the company's estimated internal timeline of five to seven years. As it turns out, Morgan Stanley analyst Katy Huberty estimates the automotive space could pave the way for Apple to double its revenue and market cap in the future.

Finally, the company's services business is growing at a faster pace than its product business. The services business generated $19.5 billion in revenue in the first quarter of fiscal 2022, up 24% from the prior-year period. This exceeded the 9% growth in Apple's revenue from product sales as well as the 11% year-over-year growth in the company's total revenue to $123.9 billion.

The addition of new hardware products to Apple's portfolio bodes well for the services business as the company will be able to bring more users into its ecosystem. Analysts expect the services business to clock 15% to 20% growth for the next few years due to stronger hardware penetration and new offerings. This potential growth of the services business points toward an improvement in Apple's earnings power. That's because the services business reported a gross margin of 72.4% last quarter as compared to the 38.4% margin of the products business.

Not surprisingly, analysts expect Apple's earnings to grow at nearly 15% a year for the next five years as compared to just 8.4% annual growth over the last five. As such, Apple could continue to be a top growth stock well into the future.

2. Intel

Intel may look like a surprising choice to invest $5,000 in given that the stock has underperformed the broader market over the past five years.

^SPX Chart

^SPX data by YCharts

However, Intel stock could turn out to be a top performer over the next five years as the semiconductor giant now appears to be in turnaround mode. The launch of Intel's Alder Lake central processing unit (CPU) platform in late 2021 has started turning the tables in the company's favor against rival Advanced Micro Devices.

According to CPU benchmarking software provider PassMark, Intel's share of the CPU market has increased to 65.8% in the first quarter of 2022. This points toward a turnaround in Intel's fortunes as the company's share dipped to 60.2% in the third quarter of 2021 from more than 82% in the fourth quarter of 2016.

It is also worth noting that Intel is witnessing a shift in the server market, with a market share of 97% in the first quarter of 2022, up from 91.6% in the third quarter of 2021. This reversal in Intel's fortunes of late isn't surprising as the company has bridged the technology gap with rival AMD.

More importantly, Intel is now intent on keeping up the pressure on its rivals by ramping up capital spending and consistently rolling out competitive platforms. For instance, Intel has outlined $27 billion in capital expenditure this year, up substantially from last year's outlay of $18.7 billion. More specifically, Intel will spend 35% of its projected 2022 revenue as capital expenditure, and it expects to maintain this level through 2024.

The company intends to "regain process performance parity by 2024 and leadership by 2025," according to CEO Pat Gelsinger, by launching five processor platforms over the next four years. What's more, Gelsinger says that Intel is on or ahead of schedule as far as the development of its upcoming process nodes is concerned, which explains why the company is confident in its ability to return to double-digit revenue growth by 2025.

Chipzilla expects to clock 10% to 12% annual revenue growth from 2025, and maintain that momentum in 2026. It also anticipates a gross margin between 54% and 58% by then, which points toward a nice bump over its projected 2022 gross margin of 52%.

Intel seems to be executing well as far as its turnaround is concerned. The company was able to reduce wafer costs by 30% year over year in the fourth quarter of 2021, and it also increased its substrate capacity by a record margin.

As such, it won't be shocking to see Intel become a solid tech investment in the long run. So, investors should consider buying it right away as it is trading at less than 10 times trailing earnings as compared to the Nasdaq-100's price-to-earnings ratio of 33.