Warren Buffett has one of the best and longest track records and is considered by many to be the greatest investor ever. Even at 93 years old, his mind seems as sharp as ever.

The average investor could boost their portfolio returns by looking at the stocks Berkshire Hathaway owns. If a company passes Buffett's test, it may be worth considering.

As of this writing, Apple (AAPL -0.35%) makes up a notable 47.5% of the conglomerate's portfolio. Clearly, the Oracle of Omaha thinks highly of the dominant tech business. Let's take a closer look at what attributes drew Buffett to Apple and what prospective investors should do right now.

It's easy to see why Buffett bought shares

Berkshire first purchased shares in Apple during the first quarter of 2016. Although additional purchases were made after that point, that initial investment paid off extremely well. From the start of 2016 to Oct. 5 of this year, Apple stock has soared 565%, a gain that crushes the major indices.

Anyone who follows Buffett knows that his investing philosophy focuses on finding high-quality businesses at reasonable valuations. Apple's valuation was very attractive when he first bought the stock, and this certainly helped boost returns. During the first three months of 2016, shares traded at an average price-to-earnings (P/E) of just 10.6. That seems like a steal in hindsight and shows that perhaps the market was a bit too pessimistic about Apple back then.

Buffett has long been notorious for avoiding companies in the tech sector, so it was surprising when Apple was added to Berkshire's portfolio. But I think after studying the business, he realized that the key to Apple's story was its strong brand and incredible customer loyalty. Buffett has an appreciation for powerful brands, as evidenced by Berkshire's stakes in Coca-Cola and American Express, for example. Apple's gross margin of 44% in the latest quarter (Q3 2023, ended July 1) is indicative of its brand presence.

By offering some of the most innovative and easy-to-use products on the market, like the iPhone, Watch, AirPods, and MacBook, Apple has proven pricing power due to what seems like unlimited demand. And because of a burgeoning services segment, customers are essentially locked into the ecosystem. From an investment perspective, this is wonderful to see.

All of this results in tremendous financial performance. In fiscal 2015 (ended Sept. 26 of that year), Apple posted an operating margin of 30.5% and generated free cash flow of $70 billion, figures that have grown rapidly since then.

Another part of Buffett's criteria is ensuring the company has a talented CEO. After the death of Steve Jobs, many wondered whether Apple would be as successful. But Tim Cook has performed exceedingly well, as shown by the stock price. And Buffett hasn't been shy to voice his support of Apple's leader.

Is Apple a smart buy today?

Apple has worked out as one of Berkshire's best investments ever, but how does that affect investors who have been sitting on the sidelines up until now? I think two main factors should influence your decision about wanting to buy the stock today.

With such strong share-price performance in recent years, Apple isn't even close to being as cheap as it was more than seven years ago. The stock currently trades at a P/E multiple of 29.4. That's a steep premium that limits the potential for market-beating returns.

Besides the valuation, investors must think about Apple's growth prospects. This is a massive and mature enterprise nowadays, so it's hard to see where the outsize gains could come from to justify paying an expensive P/E ratio. Moreover, smartphone sales, which still represent about half of the overall company, could be saturating, especially in the U.S.

Apple is a wonderful business, but it might not be such a great idea to buy the stock right now.