Shares of e-commerce and cloud-computing company Amazon.com (AMZN 3.43%) spiked more than 5% on Thursday, following the company's announcement of its upcoming 20-for-1 stock split. The news, along with the stock's sharp gain on Thursday, likely has many investors wondering whether now is a good time to buy shares.

To answer this question, we'll take a closer look at the anatomy of stock splits, why Amazon shares may be trading higher, and whether the stock looks attractive today.

A hand holding a smartphone in front of a blackboard full of charts.

Image source: Getty Images.

Amazon's stock split -- and why it's not a buy signal

On Wednesday afternoon, Amazon announced that its board approved a 20-for-1 stock split. While shares sometimes jump after stock splits are announced, investors should understand that stock splits do not create any incremental intrinsic value for shareholders. In other words, stock splits are not a reason to buy a stock.

All that happens in a stock split is a company's shares get divided. For instance, if a stock with a $1,000 share price split its shares in 10, each shareholder would have 10 shares for every one they previously owned -- and the value of those shares would be $100 each. The investor in this example, therefore, would have the same total investment value before and after the stock split.

It's like taking a whole pizza and slicing it up. You're still left with the same amount of calories to consume before and after the pizza was cut.

The stock split, Amazon said in a filing with the Securities and Exchange Commission, is currently scheduled to take place on May 25. Trading of the stock on a split-adjusted basis is expected to begin on June 6. 

The real reason for Amazon investors to be bullish

While Amazon stock may have jumped on Thursday mainly because of stock split news, the real reason investors should be more upbeat about the stock this week is Amazon's news in conjunction with its stock split announcement: the board authorized $10 billion for repurchasing its stock.

"The program allows the Company to repurchase its shares opportunistically from time to time when it believes that doing so would enhance long-term shareholder value," Amazon said in its SEC filing. This authorization is double the company's previous $5 billion program -- an authorization that was granted in 2016.

Since 2016, Amazon had only repurchased $2.12 billion worth of shares. With the company announcing a $10 billion share-repurchase program even before the previous program was fully exhausted, this may be a signal that management thinks its shares are undervalued and that it's time to step up its repurchasing.

Is Amazon stock a buy?

Amazon management may be onto something with its $10 billion share-repurchase authorization. Shares do look undervalued today.

A surface-level look at the growth stock, however, may fool investors to believe that shares are overvalued. Its price-to-earnings ratio of 45, for instance, looks pricey at first glance. But here's what investors need to know: Analysts, on average, expect the company's earnings per share to compound at about 35% annually over the next five years.

Sure, investors should take analyst estimates with a grain of salt. But the company has demonstrated significant margin expansion over the last decade as a result of its scalable business model -- and this trend is likely to continue in the future, leading to outsize earnings growth, relative to revenue.

One obvious catalyst for margin expansion is the company's cloud-computing business, Amazon Web Services (AWS), which is growing faster than Amazon's core e-commerce business and has a higher operating margin (30% for AWS, versus the company's core North America operating margin of 2.5%). As AWS grows as a percentage of Amazon's total revenue, this should bolster the company's consolidated operating margin and help earnings grow at a rapid clip.

While there are risks to any investment, Amazon stock looks like it will likely prove to be an attractive long-term investment from this level.