Western Digital (NASDAQ:WDC) and Intel (NASDAQ:INTC) both provide crucial components for PCs, servers, and other electronics. WD is one of the world's largest producers of platter-based HDDs (hard disk drives), NAND flash memory, and NAND-based SSDs (solid-state drives). Intel is the world's largest producer of x86 CPUs for PCs and servers.

Both companies have faced intense headwinds over the past few years. WD struggled with sluggish demand for its legacy HDDs and declining memory chip prices. Intel struggled with severe chip shortages and delays, which enabled its smaller rival AMD (NASDAQ:AMD) to increase its market share.

An illustration of a semiconductor.

Image source: Getty Images.

Both companies also switched leaders throughout their struggles. WD's CEO Steve Milligan retired last year, handing the reins over to Cisco's former networking chief David Goeckeler. Intel's CEO Brian Krzanich resigned in 2018 due to an inappropriate relationship with an employee, and was succeeded by his CFO Bob Swan -- who was recently replaced with VMWare's former CEO Pat Gelsinger.

Over the past three years, WD's stock declined about 20% as Intel's stock rose more than 35%. Investors seemed to have more faith in Intel, but is it still a better investment than WD today?

Western Digital's declines are bottoming out

WD's revenue rose just 1% to $16.7 billion in fiscal 2020, which ended last July, as the double-digit growth of its data center business barely offset its declining sales to other markets.

Its gross margin contracted as the declining margins of its HDD business offset the rising margins of its flash business amid stabilizing NAND prices. As a result, its full-year adjusted EPS fell 37%.

In the first six months of fiscal 2021, WD's revenue fell 5% year-over-year to $7.9 billion as pandemic-related disruptions and the delay of a big cloud deal offset its stronger sales to PC makers. Its gross margin expanded thanks to higher NAND prices, and its adjusted EPS rose 40%.

WD expects its three core businesses to stabilize, and analysts expect its revenue to dip 4% for the full year before growing 15% next year. They expect its adjusted earnings to dip 3% this year before more than doubling next year -- assuming the pandemic passes and NAND prices continue to rise.

Micron's latest earnings report, which offers a rosy outlook for the NAND and DRAM markets, supports that bullish thesis.

Intel faces a murkier future

Intel's chip shortage, its market share losses to AMD, and the ongoing delays at its 7nm node all kept the bulls at bay over the past year.

Servers in a data center.

Image source: Getty Images.

Intel's growth initially seems stable. Its revenue rose 8% to $77.9 billion in fiscal 2020, which ended last December, and its adjusted earnings grew 9%. But its gross and operating margins contracted, and it relied heavily on buybacks to boost its EPS.

Its sales of data center chips dipped year-over-year in the third and fourth quarters due to COVID-19 headwinds and sluggish spending from government, enterprise, and cloud customers, and nearly offset the stable growth of its PC chips as more consumers bought new PCs for remote work, online learning, and video games.

The road ahead looks even murkier. Intel's foundry remains far behind TSMC (NYSE:TSM), which manufactures chips for AMD and other fabless chipmakers in the "process race" to create smaller chips, and Gelsinger is resisting calls to follow AMD's lead and outsource all of its production to TSMC.

As a result, analysts expect Intel's revenue to decline 7% in 2021 and stay nearly flat next year. They expect its earnings to tumble 11% this year as Intel ramps up its spending to resolve its production issues, and rise just 2% next year.

The dividends and valuations

WD suspended its dividend last May, and it probably won't resume those payments until its business stabilizes. Intel didn't touch its dividend during the crisis, and it still pays a forward yield of 2.3%.

Both stocks are cheap: WD trades at just 11 times forward earnings, while Intel has a forward P/E ratio of 13. Yet WD arguably deserves a higher multiple, since it's closer to a cyclical trough than Intel -- which will likely experience a significant downturn this year.

I'm not a fan of either stock right now, especially when there are more appealing tech stocks to buy. But if I had to choose one over the other, I'd stick with WD, because its declines are bottoming out. Meanwhile, Intel must prove it can fight back against AMD after being pinned against the ropes for far too long.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.