Although this bear market has been brutal, investors who have prudent long-term plans and are adding to their portfolios on a regular basis may be licking their chops. After all, bear markets are only worrisome if you need cash in the near term. For long-term investors, bear markets are terrific opportunity to add high-quality names at discounted prices.

This year, exciting technology stocks that have outperformed over the past decade are down much more than the broader market. That means tech stocks could be among the best buys for the long-term investor today.

Among the most-loved tech stocks is Apple (AAPL 0.50%), a Warren Buffett favorite and the largest stock in the Nasdaq Composite and S&P 500 indices. But with investors able to get diversified exposure through low-cost exchange-traded funds, is Apple a better buy today than the beaten-down technology index overall?

Year to date, Apple has been more resilient

Even though the smartphone and PC markets are in for a decline this year, Apple's stock has actually outperformed the Nasdaq Composite year to date, declining nearly 22% versus a 32% decline for the Nasdaq index.

Why the outperformance? Well, unlike many tech stocks, Apple generates substantial free cash flow on a consistent basis. Although profits do bounce around depending on overall device sales, Apple's brand power allows the company to charge a premium compared to other device makers. And its vertically integrated structure, in which it makes its own operating system, software, and even some of its own semiconductors, also helps margins due to cost efficiency.

Meanwhile, global scale allows the company to generate substantial leverage on its fixed costs at headquarters and in research and development. Finally, Apple has done a great job developing and growing its high-margin services segment, which accounted for about 31% of total sales last quarter.

The importance of smartphones, recurring services revenue tied to a growing installed base, and consistent cash flow have transformed the way investors see the company in recent years. Whereas it was often viewed as a cyclical hardware maker in the early part of the past decade, many investors now see Apple more as a safe consumer staple.

That has spurred them to pay a higher multiple for Apple, as its price-to-earnings ratio has increased from the low teens before 2018 to a low- to mid-20s P/E today:

AAPL PE Ratio Chart

AAPL PE Ratio data by YCharts.

Near-identical multiples

Today, Apple's P/E of 22.8 is virtually identical to the overall P/E ratio of the Nasdaq, at 22.9.

The similarity is interesting: Apple, as the largest company in the world, will probably struggle to grow as fast as smaller technology stocks that are earlier in their corporate lives, or are currently in a cyclical downturn that will snap back when the economy turns around.

The Nasdaq's multiple has actually fallen more than Apple's over the past year, with the former falling from 34 to 22.9, and the latter falling from the high 20s to 22.8. The difference likely has to do with risk, as Apple is perceived as a safer name than the average Nasdaq stock.

But is the Nasdaq due for a snapback?

Over the course of the past 10 years, Apple has outperformed the Nasdaq Composite by a considerable amount, growing investors' wealth by 487%, versus just 240% for the Nasdaq. However, Apple was actually trailing the Nasdaq Composite for the first eight years of that time frame, only shooting higher as the pandemic hit:

AAPL Chart

AAPL data by YCharts.

The recent extreme outperformance makes me nervous as an Apple shareholder: It's possible it could reverse, at least to some degree.

In recent weeks and months, some key components of the Nasdaq have also taken a beating. For instance, large Nasdaq component Adobe cratered after announcing its $20 billion acquisition of Figma. Meta Platforms, another large component, is down a huge amount on the slowdown in social media advertising, competition from TikTok, and high spending on the metaverse. The Nasdaq also contains lots of cyclical semiconductor stocks, which have also fallen much more than Apple and the broader market on concerns over an economic slowdown.

Given the big decline in Nasdaq stocks, I think Nasdaq components have more room to grow their P/E ratios on a recovery -- Apple is already a very large company, making it harder to grow. So it's quite possible the Nasdaq will outperform it over the next year.

But the long term may belong to Apple

It's interesting to compare Apple and the broader Nasdaq, as they actually do a lot of the same things for their owners. Apple is a relatively safe stock with a wide moat based on a premium brand, excellent management, and diversified revenue streams. In that sense, it's "safer" than the average Nasdaq stock.

On the other hand, you get additional safety in the diversification in the Nasdaq. It gives you exposure to younger, higher-growth companies, but will also expose you to some underperformers. With an index fund, investors' return is roughly that of the underlying index. That takes away the risk of outsized relative losses, but also means average performance.

In other words, the diversification of the Nasdaq does a lot of the same things that the "staple" status does for Apple. Making the decision more complicated, Apple actually makes up 13.3% of the Nasdaq today, so with a Nasdaq-based fund you're still getting significant exposure to Apple.

How to decide?

So what to do? After its recent run of outperformance, I think the Nasdaq could very well be a better buy for investors over the next one to two years. However, over the long term, I also think Apple's brand and high profits should prove more resilient than the average Nasdaq stock.

On the other hand, if you do buy Apple over the Nasdaq, you're also taking single-stock risk. As we've seen with stocks like Meta, even seemingly invincible market leaders can stumble at times.

Therefore, either path looks like a good choice, depending on your orientation as an investor. Risk-averse investors may want to go with a Nasdaq-based fund for diversification; if you hold a more concentrated, high-quality portfolio for the long term, as Warren Buffett does, Apple could be the way to go. It's a pretty close call, and a matter of investor preference.