Chances are, you're well aware of eBay (NASDAQ:EBAY) -- one of the world's largest auction sites for buying and selling goods online. But have youd heard of Shopify (NYSE:SHOP)? Unless you're an investor by trade, the name probably doesn't mean much.

And yet, there are over 500,000 companies that rely on Shopify to provide a real-time e-commerce presence. Most of those companies are small operations, but there are larger members of the roster as well: Tesla, Budweiser, and Red Bull -- to name a few -- all rely on Shopify to manage their e-commerce machines.

A person using a tablet to buy things online.

Image source: Getty Images.

So does that type of growth, obscurity from the public eye, and ubiquity make Shopify a better buy than the well-known e-commerce player in eBay? That's not a question that can be answered with 100% certainty. But just because we can't predict the future doesn't mean we can't dig deeper. If we compare the two stocks on three crucial variables, we can see how they stack up.

Sustainable competitive advantage

Beyond a shadow of a doubt, my decade as a Foolish investor has taught me that the most important thing for buy-to-hold investors to evaluate is a company's sustainable competitive advantage -- or moat. In the simplest sense, this is the "thing" that keeps customers coming back month after month while holding the competition at arm's length for decades.

eBay benefits from a powerful moat in the form of its network effect. As more sellers of goods go to the auction site to find buyers, buyers are further incentivized to visit the site. That, in turn, attracts even more sellers. It's a virtuous cycle that benefits eBay, which can then take a cut of each transaction. It's worth noting, however, that the strength of this network effect has stalled lately, as growth merchandise volume has barely moved in the past four years.

Shopify benefits from another very strong moat: high switching costs. Once a small or medium-sized business sets up all of its e-commerce operations on a single platform, they would be loath to switch. Not only can doing so incur significant financial costs, but it creates endless headaches, risks downtime for customers, and necessitates retraining for employees.

The real difference maker between these two comes from the fact that Shopify has become so strong recently that it, too, has started to benefit from the network effect. Over the past year, 130 million people have bought things from Shopify-powered businesses. That popularity has led third-party app developers to flock to Shopify, creating 1,800 tailored tools for Shopify customers that the competition simply can't compete with.

The combination of those two forces gives Shopify the edge here.

Winner = Shopify

Financial fortitude

Most of the time, we investors like to see two things happen with cash: see it reinvested in growth opportunities or given back to us via dividends and share buybacks.

But there's something to be said for boring old cash: It makes a company stronger in the face of crises. And don't fool yourself, the possibility of the next financial crisis -- whether macro or company-specific in nature -- is ever present.

Companies that have cash on hand have options in such situations: outspend rivals to gain market share, acquire the competition, or buy shares back on the cheap. Often, they will emerge stronger as a result. Debt-heavy companies are in the opposite boat, forced to cede long-term market share in an attempt to live to fight another day.

Keeping in mind that eBay is valued at roughly four times the size of Shopify, here's how the two compare.

Company

Cash

Debt

Net Income

Free Cash Flow

Shopify

$932 million

$0

($46 million)

($16 million)

eBay

$12.8 billion

$9.3 billion

$7.4 billion

$2.1 billion

Data source: Securities and Exchange Commission filings, Yahoo! Finance. Net income and free cash flow presented on trailing twelve-month basis.

Here we have a mixed boat. eBay has money coming in the door and a manageable debt load, while Shopify has absolutely no debt to speak of but is also losing money.

I would argue that these two factors balance each other out. In fact, as a shareholder, I don't want Shopify to be profitable for a while. But if tough times hit, the company could easily become free-cash-flow positive.

Winner = Tie

Valuation

And then we have the can of worms that is valuation. There's no one metric that can tell you just how expensive a stock is. Instead, I like to use a number of data points to get a more holistic picture.

Company

Price-to-Earnings Ratio

P/E Ratio (Expected 2019)

Price-to-Sales Ratio

Shopify

N/A

131

18

eBay

18

14

4

Data source: SEC filings, Yahoo! Finance, E*Trade. P/E represents non-GAAP earnings.

This is a very difficult metric to evaluate, as Shopify's lack of profitability and fast growth make apples-to-apples comparisons impossible.

That being said, even if we look out way into the future -- 2019 to be specific -- Shopify is trading at a much higher premium than eBay in terms of predicted earnings. While most finance sites have eBay's P/E listed at a lower multiple because of one-time events that should be discounted, the company is still cheaper on just about every meaningful metric.

Winner = eBay

My winner is...

So there you have it: Both companies have solid balance sheets. eBay is cheaper, but Shopify's moat is wider. Whenever I have such a tie, I use the sustainable competitive advantage as the tiebreaker. In this case, that means siding with Shopify. Currently, its shares make up over 3% of my real-life holdings, while I don't own eBay stock, as eBay's moat doesn't match my own investing style.

Brian Stoffel owns shares of Shopify and Tesla. The Motley Fool owns shares of and recommends Anheuser-Busch InBev NV, eBay, Shopify, and Tesla. The Motley Fool has a disclosure policy.