Shares of Microsoft (MSFT 1.82%) are up 61% over the last 12 months, putting them close to a new all-time high. The software leader is expected to benefit tremendously over the next several years from the emergence of artificial intelligence (AI) technologies.

DA Davidson analyst Gil Luria recently maintained a buy rating on the stock with a $500 price target -- that's 22% higher than the current share price of $408. There was a key theme from last quarter's earnings report that explains why Wall Street analysts across the board are bullish on Microsoft's future.

Why buy Microsoft stock

Microsoft isn't just talking about AI, they are implementing across the business and monetizing it. This was the key theme from the company's December-ending fiscal second quarter, in which revenue grew 18% year over year (16% on a constant-currency basis).

What seemed to impress analysts the most was the company's margin performance. Despite investments in AI, gross profit margin increased one point driven by the Azure cloud business and Office 365. Overall, this contributed to stellar growth on the bottom line where adjusted earnings soared 26% over the year-ago quarter (23% in constant currency).

Microsoft is working hard to deliver the AI improvements that customers are demanding, but they are also focused on delivering profitable growth to benefit shareholders. It's this reason that explains why Wall Street is bullish on Microsoft. Out of 55 analysts that cover the stock, 52 rate it a buy, and the remaining three rate it a hold.

Microsoft's ability to roll out AI features in a timely manner and still keep earnings growing at high double-digit rates is why the stock can hit new highs in 2024 and beyond.