Perhaps no two tech-oriented, consumer product companies are ingrained in U.S. consumers' everyday lives as much as Amazon (AMZN 2.19%) and Apple (AAPL 0.40%).

Amazon is the leader of e-commerce, controlling a nearly 38% market share in the U.S. It's next closest competitor is Walmart, which has a less than 7% market share.

Apple, meanwhile, is estimated to hold a more than 59% market share in the smartphone market in the U.S.; Samsung is a distant second at 23%.

While both companies have dominant market positions in the U.S. in their respective fields, the question is which stock is the better buy at the moment?

Growth and future prospects

Amazon has been solidly outperforming Apple on the revenue growth front the past few quarters. The e-commerce giant has been able to grow its revenue by double digits each of the past four quarters, including by 13% last quarter to $143.3 billion.

Apple, on the other hand, has been struggling with growth. The company has only seen its revenue increase once in the past four quarters, a scant 2% gain in its December quarter. Last quarter, meanwhile, revenue fell 4% to $90.8 billion. The company has been hampered by struggling iPhone sales in China and a lengthening replacement cycle.

Both companies are looking toward artificial intelligence (AI) to help spur growth.

While not growing as quickly as its two main cloud computing competitors, Amazon's Amazon Web Services (AWS) segment is still showing solid revenue growth, up 17% last quarter. The company plans to increase capital expenditures to expand its data center operations in order to meet the increasing demand for generative AI. The company believes this upfront investment will lead to strong free cash flow and better operating margins down the road.

The company is also helping customers build out their own AI solutions through its Bedrock and SageMaker platforms. With BedRock, the company is providing foundational large language models (LLMs) from both itself and AI start-ups, while SageMaker helps customers create their own AI models.

Apple, meanwhile, has just jumped into the AI race with a number of AI features that will be powered by its Apple Intelligence solution. Apple Intelligence will be incorporated into its latest operating systems and be able to be used within its own and third-party apps while maintaining user privacy. It will also be added to its voice assistant, Siri, to help with various tasks such as finding a specific photo or hotel booking information.

The big hope for Apple is that the new AI features will help spur a hardware upgrade cycle, as later versions of its devices are generally needed to run these AI-related functions. The company has seen upgrade cycles start to lengthen, so these new features and future AI capabilities could spur people to more quickly upgrade their smartphones and computers.

A woman shopping on a tablet.

Image source: Getty Images

Valuations

Apple stock trades at a forward price-to-earnings (P/E) ratio of under 33, lower than Amazon's forward P/E of over 40.

AAPL PE Ratio (Forward) Chart

AAPL PE Ratio (Forward) data by YCharts

However, Amazon has been growing its revenue at a much faster clip than Apple, which has struggled to grow its revenue over the past 12 months. Amazon has also been seeing more earnings growth, as the company leverages fixed costs to grow its bottom line.

Both companies have solid balance sheets. Amazon carries about $8 billion in net cash, while Apple has a whopping $68.6 billion in net cash on its balance sheet. Apple's large cash position and prolific free cash flow give it a lot of flexibility to buy back shares, and the company recently announced an additional $110 billion share repurchase program.

The winner

Amazon and Apple have proven to be two of the most successful companies in the world, and both should be long-term winners for investors. If I had to choose only one, I'd pick Amazon at this time given its higher growth. The company has also shown a willingness to spend a lot of cash in order to win in the past, and combined with the potential of AI, I think this will be a winning strategy.

However, considering the potential of a hardware upgrade cycle due to AI, a cheaper valuation, and a boatload of cash, I wouldn't just toss Apple aside. Fortunately, investors can own both of these solid stocks if they choose.