Last week's blockbuster M&A news was that Amazon.com (NASDAQ:AMZN) had agreed to acquire organic grocer Whole Foods Market (NASDAQ:WFM) in a $13.7 billion deal, which would be the e-commerce company's biggest acquisition ever by a large margin. Prior to Whole Foods, the largest acquisition in Amazon's history was Zappo's for $1.2 billion, followed by Twitch for $970 million.

There are plenty of angles to analyze in this deal, but I wanted to look at one in particular: how Amazon is funding it.

Cash is king

The deal is an all-cash transaction that values Whole Foods at $42 per share. For reference, Amazon closed out the first quarter with $21.5 billion in total cash, so the purchase will consume the majority of Amazon's total cash. It gets even more complicated, though: Not all of that cash is held domestically.

Whole Foods store

Image source: Whole Foods.

Amazon doesn't disclose its mix of domestic vs. foreign cash quarterly like other companies, but does so on an annual basis in its 10-K. As of the end of 2016, $8.6 billion of Amazon's cash was held by foreign subsidiaries (out of the total $26 billion in cash it had at that time, putting domestic cash at $17.4 billion). Even without knowing precisely how much of Amazon's cash is currently held domestically, $13.7 billion would gobble up almost all of the domestic holdings.

This is all why Amazon is taking on debt to help fund the deal, even though that wasn't explicitly stated in the press release. In connection with the deal, Amazon filed a commitment letter from lenders with the SEC, indicating that it will take on $13.7 billion in debt to fund the acquisition of the company Amazon had previously referred to under the code name "Walnut," in order to keep the deal under wraps. (It didn't work, as the prospect of this deal leaked back in April.)

Amazon will issue senior unsecured debt in a public offering or private placement, use term loans, tap a new 364-day bridge loan credit facility, or some combination thereof to raise the $13.7 billion.

Why didn't Amazon use some stock?

This all begs an important question: Why isn't Amazon using its stock to help fund its largest acquisition ever?

When considering whether or not to use stock as currency in structuring an acquisition, there are several factors to consider. First, how risky is the deal? If management is confident that the deal will be successful, it should use all cash so that the acquiring company can enjoy all of the value that is created. If management is not confident that the deal will be successful, it should include a stock component as consideration, which essentially shares both the risk and potential upside with the target company's shareholders. Using all cash signals that Amazon is pretty confident in the deal.

There's another factor that's particularly relevant to Amazon, though: valuation. If the acquiring company's shares appear overvalued, then it makes sense to use stock and get more bang for your buck. If the acquiring company's shares are undervalued, then it makes more sense not to use stock. By structuring the deal as all-cash, Amazon is potentially signaling that it thinks its shares are undervalued.

The tricky part is that Amazon shares have long sported quite a premium, priced at 186 times earnings currently. It goes without saying that nearly all companies are biased in thinking that their shares are undervalued, but objectively it's hard to argue that Amazon is undervalued with shares hovering near all-time highs and Amazon's market cap approaching $500 billion.

It's peculiar that Amazon wouldn't even split the difference -- say, by offering half cash and half stock. The good news is that if there's one thing that Amazon investors have learned over the decades, it's to trust Jeff Bezos.

John Mackey, CEO of Whole Foods Market, is a member of The Motley Fool's board of directors. Evan Niu, CFA has no position in any stocks mentioned. The Motley Fool owns shares of and recommends Amazon and Whole Foods Market. The Motley Fool has a disclosure policy.