All eyes have been on tech companies since a boom in artificial intelligence (AI) kicked off last year.

Big Tech companies like Amazon (AMZN -1.61%) have rallied investors, with the stock up 69% in the last 12 months. The retail giant has gained support by delivering solid growth in its e-commerce segment and investing heavily in the budding AI market. Amazon is on a promising growth path that might see it flourish over the long term.

However, it could be worth investing in a company that is at an earlier stage in its AI venture (with potentially more room to run) and has a history of outperforming Amazon's stock.

AAPL Chart

Data by YCharts

Amazon has made many millionaires over the years, with its share price nearly doubling since 2019. However, the chart above shows Apple's (AAPL 0.50%) stock has climbed almost three times higher than Amazon's in the same period.

Apple has taken a slower approach to AI than Amazon since the start of 2023, but recent developments suggest Apple is gearing up to make a big splash in the sector this year.

So, forget Amazon. Apple has made far more millionaires and will continue to make more.

An edge over the AI consumer market

Apple has achieved almost unrivaled brand loyalty with its customers over the years. Consumer preference for its products was best conveyed by Warren Buffett last year when he said, "If someone offered you $10,000 to never buy an iPhone again, you wouldn't take it." While surprising, the sentiment rings true for millions of consumers who would sooner give up many other brands before straying from Apple.

The company has strategically created an interconnected ecosystem for its devices that discourages users from switching to rival products. Advanced connectivity and Apple-exclusive apps like Messages and FaceTime have become integral to many people's workflows, keeping them within the company's ecosystem even when it comes time to upgrade.

Apple has achieved leading market shares in many of its product categories, including smartphones, tablets, smartwatches, and headphones. Meanwhile, the wide use of its products allowed the company to quickly expand in digital products, with its services segment becoming its second-highest earning division (only after the iPhone).

Services quarterly revenue has risen 36% over the last three years, significantly outpacing the iPhone's growth of 16%.

It's no secret that Amazon similarly has a vast user base, with its retail site available in about 20 countries. Meanwhile, it's home to the world's biggest cloud platform, Amazon Web Services (AWS), where it is rapidly expanding its AI offerings to businesses. However, Apple could arguably fare better in the consumer space of AI over the long term by leveraging the popularity of its products.

The iPhone maker's devices could become a major growth driver in the public's adoption of AI, proven by the success Apple has already had touting its digital services. On May 7, Apple held its "Let Loose" event, where it debuted its newest iPad Pro. The tablet is the first device to be equipped with Apple's M4 chip, its most powerful chip yet.

The M4 significantly expands Apple's AI capabilities and is a promising look into the company's future in AI. Apple will hold its Worldwide Developer Conference in June, where it is expected to build on its recent event by unveiling a range of new AI-powered features. Meanwhile, Bloomberg reported in April that the company plans to overhaul its Mac lineup to focus on AI offerings.

Apple is a far better value than Amazon

Amazon has won over many investors this year. However, while its rally has benefited current investors, it has also raised the price of entry for new ones. Meanwhile, recent hurdles have kept Apple's stock at a more attractive price point.

AMZN PE Ratio (Forward) Chart

Data by YCharts

This chart shows Apple has a significantly lower forward price-to-earnings (P/E) ratio and price-to-free cash flow ratio. These are helpful metrics when determining a stock's value as they take into account the company's financial position. For both, the lower the figure, the better the value. And Apple wins on both fronts.

Moreover, Apple's free cash flow of $101 billion is far higher than Amazon's $46 billion, suggesting Apple could be better equipped to invest in its business and overcome potential headwinds.

Alongside immense brand loyalty and an expanding position in AI, Apple's stock is a no-brainer that could make you a millionaire with the right investment.