Apple (AAPL 1.10%) has historically been one of the best investments in the stock market. For a while, it was the poster child for growth stocks. Unfortunately, this year hasn't been Apple's best performance, with the stock down 5.5% through Aug. 27.

When you zoom out, Apple's performance hasn't been terrible, but it also hasn't been what you might expect from one of the most successful businesses in history. If you had invested $1,000 in Apple stock five years ago, your investment would be worth around $1,830 today, or $1,870 if you include dividends.

Again, this isn't terrible. However, if that same $1,000 had been invested in the S&P 500, it would be worth around $1,870, or $2,015 with dividends.

AAPL Chart

AAPL data by YCharts.

Why has Apple's stock lagged?

Much of the S&P 500's growth has been driven by the "Magnificent Seven" stocks (of which Apple is one) and the recent hype surrounding AI-related developments. Unfortunately, it appears that Apple has been lagging behind in these developments.

Companies like Nvidia, Microsoft, Alphabet, and Amazon have all demonstrated tangible AI capabilities and applications. Apple, on the other hand, hasn't had much concrete AI stuff to show. The company says it will increase investments to catch up on AI developments, but the market appears to remain skeptical until it sees Apple's AI plans come to life.

Apple is known for being cautious when introducing new technologies before they're well-polished, so its relative slowness to adopt AI isn't entirely surprising. If the company returns to its innovative roots, I imagine the next five years could be much better than the previous five.