One of Apple's (AAPL -0.35%) biggest supporters over the past decade has been Warren Buffett and his team at Berkshire Hathaway. He originally purchased shares of Apple in 2016 and has continuously added to his position. However, Berkshire's latest 13F filing (a document filed with the SEC that reveals trades of companies with greater than $100 million in investments) made a surprising move: Berkshire sold some Apple shares.

While most would consider this a shock, I don't. The writing has been on the wall for Apple for some time, and Berkshire's latest move makes complete sense when you examine the company. But should other investors follow Buffett's lead here?

Apple's business has been struggling lately

Most people are familiar with Apple's business; its product ecosystem has been popular in the U.S. for some time. Whether it's the iPhone, Macbook laptop, iPad, AirPods, or any of its other products, Apple has captured a large chunk of business through its seamless integration with each one of its products.

However, Apple has struggled lately. As Apple's products have improved, the technological jumps when upgrading from generation to generation diminished. This has pushed out sales cycles and prevented Apple from achieving meaningful growth. While Apple grew its revenue by 2% in the first quarter of fiscal year 2024 (ended Dec. 30, 2023), that was the first quarter in five where Apple's revenue increased.

Despite that, Apple's stock has risen 40% since the start of 2023, something few companies could achieve if they posted growth rates similar to Apple's during that time frame.

As a result, Apple's stock has gotten quite pricey. When Buffett and Berkshire first took a position in Apple, it traded for around 10 times earnings.

AAPL PE Ratio Chart

AAPL PE Ratio data by YCharts.

Apple was clearly undervalued at that price, so Berkshire made the smart decision and loaded up on the stock. Today, it commands a pricey 28 times earnings -- a level usually reserved for companies growing rapidly.

As discussed above, Apple doesn't fit into this category, so savvy companies like Berkshire have started to trim their position, believing the stock is overvalued.

But should you follow suit?

Apple's stock fetches a premium valuation for mediocre performance

In my opinion, this isn't the last of Berkshire's Apple sales, especially if the price remains elevated. However, the broader market also recognizes Apple's overvaluation, which is why Apple's stock price has fallen 5% this year while the S&P 500 is up more than 5%.

Since 2016, Apple's average price-to-earnings (P/E) valuation was 22. This probably represents a fair price for Apple, and I wouldn't be surprised if the market continues to sell off the stock until it reaches this threshold.

However, an argument could also be made that this is still too expensive.

According to Wall Street analysts, they expect revenue growth of 1.3% in fiscal year 2024 and 6.3% in fiscal year 2025. That's not very rapid and could cause many investors to exit the stock as it transitions from growth mode to value-returning mode.

However, Apple can still be a winning investment. Over the past 12 months, Apple has produced more than $100 billion in free cash flow. It's used $78.2 billion for stock repurchases and another $15 billion for dividends.

AAPL Free Cash Flow Chart

AAPL Free Cash Flow data by YCharts.

If management realizes that its cash is better used to pay dividends than repurchasing an expensive stock, Apple's stock may perform better.

Until then, investors would be smart to follow Buffett's lead and trim some Apple stock, as it has remained at an elevated valuation with no strong business results to justify it for some time. With so many other better values in the market, there are smarter places to invest than Apple.