 Amazon and Microsoft are the number one and number two companies in the cloud infrastructure space. While Amazon pioneered the industry, Microsoft drove its recovery from the decline of the PC industry by pivoting to the cloud. Both stocks have focused heavily on artificial intelligence, AI, a technology that relies on the cloud for support. Both companies are among the largest in tech and have diverse income streams, so both AI stocks will likely outperform the S&P 500. However, one of them holds the potential for higher returns. Many investors consider Amazon an e-commerce company and may ignore Amazon Web Services, AWS, whose cloud platform drives most of its profits. Nonetheless, Amazon pioneered the cloud industry and remains the leader, excelling at AI. AWS leverages AI to help customers create new AI-driven applications without worrying about infrastructure requirements. AWS's AI can detect fraud, cybersecurity vulnerabilities, and issues with IT infrastructure. It can also analyze text and videos to extract key points. This functionality is achieved through an AI application called Machine Learning, ML, which allows the AI to learn from mistakes and adapt systems without pre-programming. This can help resolve business problems, build and scale generative AI applications, and add AI to applications. In the third quarter of 2023, AWS generated over $7 billion in operating income, well above the $4 billion combined for Amazon's e-commerce segments. This resulted in a net income of almost $10 billion for the same time frame, a considerable increase from the previous year. Investors have recognized Amazon's recovery and AI prowess, and the stock is up over 60% in the last year. With AI leading the way on the AWS side of the business, the company's fast-rising income could push the stock even higher. Microsoft's largest source of revenue now comes from its intelligent cloud segment, which supports Azure. Microsoft leverages Azure for applied AI services, cognitive functions, and machine learning. AI's reach affects virtually all parts of the company, including its productivity software. Although both stocks should prosper, Amazon will likely drive higher shareholder returns. AWS drives most of Amazon's income increases, allowing for higher rates of earnings growth. Despite Amazon's higher PE ratio, its faster rate of profit growth will likely justify the higher earnings multiple as the reach of its AI tools grows.