When Google first passed Microsoft in terms of stock market value six years ago, it looked like the companies were headed in opposite directions.

But over the past 12 months, Microsoft has surged 40 percent, more than five times Alphabet's gain, and has again become the more valuable of the two. As of Tuesday's close, Microsoft was worth $749 billion and Alphabet's market capitalization stood at $739 billion.

Microsoft's latest rally has been sparked by growth in its cloud computing business, which is bigger than Google's though it still trails Amazon Web Services. In March, Microsoft reorganized its Windows and Devices Group and moved its engineering resources into other units, including one focusing on cloud and artificial intelligence.