Shares of Apple (AAPL -0.82%) have fallen behind the return of the broader market over the last year. One of the issues weighing the stock is the perception that other tech companies like Alphabet and Microsoft are pulling ahead of the iPhone maker in artificial intelligence (AI).

But Apple is expected to finally reveal its AI plans at the Worldwide Developers Conference (WWDC) on June 10. Investors seem to be already pricing in positive news around the company's AI initiatives, with shares up 16% in just the last month. Let's look at how AI-enabled iPhones could benefit Apple, then consider what it means for the stock.

Apple's AI opportunity

Apple is very aware of the enormous opportunity to sell more devices with AI, and it's putting big money behind it. The company has invested over $100 billion in research and development over the last five years, and it's reportedly spending over $1 billion per year on AI research specifically.

AAPL Research and Development Expense (TTM) Chart

AAPL Research and Development Expense (TTM) data by YCharts

But Apple is not throwing money around. Management's commentary on the last earnings call suggests it is being very deliberate with how it is investing in this technology.

On the company's fiscal second-quarter earnings call, CFO Luca Maestri said, "We have a bit of a hybrid model where we make some of the investments ourselves. In other cases, we share them with our suppliers and partners." This approach will allow Apple to deliver new AI services to customers without having to put up the cost to build out a multibillion AI infrastructure all on its own.

Apple is exploring bringing some AI features to iPhone from third parties like Google. It has reportedly been in discussions with Alphabet about bringing generative AI to iPhones. Licensing some technology from Google, which has already built a sophisticated AI model with Gemini, would be a cost-effective strategy for adding specific software tools in iOS.

Where it makes sense for Apple to invest internally is the hardware side. Apple is reportedly building its own chips that will run basic AI tasks locally on the iPhone without sending user data to cloud servers.

Unlike Microsoft and Google, which are offering certain AI services to customers through subscription plans to directly monetize the technology, Apple can use AI to push more sales of premium iPhone models.

The next version of iOS is expected to feature several AI improvements. It would make iOS 18 the biggest update in years, but some of these features will likely require Apple's most advanced mobile chip to use. It would encourage customers still using older iPhones to upgrade to the current model, which would boost Apple's revenue and margins.

Is the stock a buy?

The Wall Street consensus has Apple's earnings reaching $8.01 per share in fiscal 2026. Assuming Apple's forward price-to-earnings ratio stays the same, investors are looking at only 30% upside based on those estimates.

However, these projections may underestimate the impact that AI will have on iPhone demand. Investors are basically getting a fairly valued stock with the potential to surprise to the upside.

All told, given the stock's recent underperformance, now could be the right time to buy shares ahead of Apple's upcoming AI splash. Investors should remember that diversification is key to managing risk in their portfolios. While Apple's potential in AI is promising, it's smart to balance investments across different sectors and companies to mitigate any potential downturns. And you should consider many potential investment ideas within the AI market, too.

Always consider your long-term financial goals and risk tolerance before making investment decisions.