Intel (INTC -9.20%) and International Business Machines (IBM -1.05%) have disappointed investors for years. Intel is facing increased competition from Advanced Micro Devices and an extremely weak PC market, while IBM is coming off a decade-long turnaround effort that's only now starting to pay off.

While it's been a tough period for Intel and IBM investors, both companies appear to be gaining momentum. Here's why shares of Intel and IBM could rebound in the next few years.

1. Intel

Semiconductor giant Intel made a critical choice a few years ago: Bet big on manufacturing rather than split itself up. Other chip companies, including rival AMD, long ago gave up on making their own chips. Intel would not only continue to manufacture its own products, as it has historically, but it would also start a foundry business and make chips for others.

That choice led to Intel spending many billions of dollars expanding its manufacturing footprint and developing advanced process nodes. The plan is to roll out five new nodes in a four-year span, culminating with the Intel 18A process in late 2024, which the company expects to be the best in the industry. Intel is on schedule so far.

These manufacturing investments coincided with a brutal downturn in the PC market, which pressured Intel's revenue and temporarily erased its profits. In the server chip market, AMD is winning market share with its solid product portfolio as Intel pays the price for past delays.

The picture is starting to look better in PCs, with global PC shipment growth expected to return in the fourth quarter. A comeback in the server chip market will likely take longer.

While Intel stock has surged this year, it's still down about 35% from its pandemic-era high. The company may never be as dominant in PC and server chips as it was in the past, but its foundry business opens an enormous market opportunity. Global spending on foundry services was nearly $107 billion in 2022, according to Allied Market Research, and it's expected to grow to $232 billion by 2032.

It will likely take until 2025 before Intel's foundry revenue really starts to ramp up, driven by the Intel 18A process hitting volume production. But if Intel can stay on schedule with manufacturing and launch the PC and server chips on its roadmap on time, the stock could continue to bounce back in 2024. The company has multiple key product launches planned over the next year, which will use its Intel 4, Intel 3, and Intel 20A manufacturing processes.

The foundry business could eventually bring in tens of billions of dollars in revenue annually, and the heavy manufacturing investments necessary to make that happen will benefit Intel's PC and server chip businesses. The time to buy Intel stock is right now, before those investments start to pay off.

2. International Business Machines

IBM has spent the better part of a decade remaking itself for the cloud computing and AI era. Following the spinoff of its managed infrastructure services business in late 2021, a low-margin business with limited growth prospects, the company is leaner and better able to go after its best growth opportunities.

Hybrid cloud and AI are at the core of the new IBM. The company is focused on serving enterprise customers with its software platforms and sprawling consulting business, offering solutions as well as guidance and help in navigating a rapidly changing technological landscape.

Both the software and consulting businesses are thriving. Software revenue was up 6% year over year in the third quarter despite a tough economy leading enterprises to become more cautious on tech spending, and consulting revenue jumped 5%. For the full year, IBM expects to grow total revenue by as much as 5% adjusted for currency. Free cash flow should come in around $10.5 billion, up about $1 billion from 2022.

The AI boom doesn't look like it's going to fade anytime soon. As enterprises and large organizations look to tap into the revolutionary technology, IBM's long history with AI and its vast array of long-standing customer relationships gives it an advantage. The watsonx platform, aimed at helping enterprises build, deploy, and manage AI models while minimizing risks, could be a significant growth driver for IBM in the long run.

IBM stock has partially recovered since bottoming out early in the pandemic, but it's still about 25% below its pre-turnaround high reached about a decade ago. The good news is that IBM is now aligned with two of the biggest trends in the technology industry: cloud computing and AI. The company won't be making headlines with its products, but it can grow steadily by helping enterprises modernize their infrastructures and deploy AI models while minimizing risks.

With a market capitalization of $142 billion, IBM stock still looks inexpensive, trading at 13.5 times projected free cash flow. A more optimistic valuation, coupled with continued free cash flow growth, sets up the stock to deliver for investors over the next few years.