These two are in rare company. How many other organizations have ruled the age of the internet quite like Facebook (META -4.13%) or Netflix (NFLX -9.09%)? We spend countless hours on each site keeping up with friends and binge-watching our favorite shows.

In fact, with the addition of Alphabet and Amazon, I think we'd be hard-pressed to find more influential companies in today's society. That fact has not been lost on investors. Over the past four years, both stocks have quintupled in value.

Young man watching his tablet with headphones on.

Image source: Getty Images.

But which is a better buy today? That's a difficult question to answer, though we can get a better understanding for what we're buying by looking at the question through three different lenses.

Sustainable competitive advantages

If I had one word of advice for beginning investors, it would be this: Spend the bulk of your time investigating a company's sustainable competitive advantages. Often referred to as a "moat" by investors, sustainable competitive advantages are what keep customers coming back for more every year and consistently keep the competition at bay.

Netflix benefits from, as I see it, three different types of moats. The first is the brand. The Qwikster fiasco not withstanding, the company has won over legions of loyal customers who appreciate the service and its original content. That original content is key, as it is gets people hooked into the Netflix ecosystem.

Management is able to target its original content because it has more data on our viewing habits than any other organization in the history of the world. That also gives the company the upper hand when it comes to paying for content from third-party providers. Imagine the negotiating table: Netflix knows just how popular certain shows are to its viewers and how valuable it is. The other side has no idea. That asymmetry provides pricing power.

Man looking at his smart phone with various social media images being projected upwards.

Image source: Getty Images.

Finally, Netflix benefits from a sneaky type of moat I only recently came to appreciate. Once customers sign on, the cost of the monthly plan is so low -- and the payments fully automated -- that a user would have to be highly motivated to cancel his/her membership.

Facebook, on the other hand, benefits from one of the most powerful moats in the world: the network effect. With each additional member who joins Facebook, non-members are incentivized to join as a way of keeping up with their friends and family. It's a virtuous cycle that is in full effect. Even though the company already has over 1 billion daily active users, its roster continues to grow -- up 18% year over year.

Not only that but Facebook gets essentially all of its content for free. That's often underappreciated by investors. Imagine what a boon it would be if Netflix never had to pay for its shows.

At the end of the day, both of these companies have powerful moats. In years past, I would have given the nod to Facebook. But my realization of how easy it is for Netflix to keep subscribers -- and how effective original content is at bringing in new users -- is enough to call this a draw.

Winner = Tie

Financial fortitude

While conservative investors love seeing cash returned to them via dividends and more aggressive investors love seeing cash reinvested in a company's growth prospects, there's something to be said for cash.

Every company will experience difficult financial times, and the companies that enter those phases with lots of cash will prosper. They will have the flexibility to outspend rivals and gain market share, repurchase stock on the cheap, and even make strategic acquisitions. Debt-laden companies will be in the opposite boat, forced to satisfy the whims of their creditors.

Company

Cash

Debt

Net Income

Free Cash Flow

Netflix

$1.7 billion

$3.4 billion

$0.2 billion

($1.6 billion)

Facebook

$30 billion

$0

$10.2 billion

$11.6 billion

Data source: Yahoo! Finance. Cash includes cash, short, and long-term investments.

Here, we have a very clear winner. Netflix is spending lots of cash on its international expansion and original programing. That's a great strategy because, as mentioned above, once customers are locked in, they're a reliable source of recurring revenue.

But with that strategy comes financial fragility. Netflix is free cash flow negative, while Facebook is a cash machine with no long-term debt whatsoever.

Winner = Facebook

Valuation

Finally, we have valuation. While this isn't an exact science, there are some straightforward metrics we can consult to give us an idea of how expensive each stock is.

Company

P/E

P/FCF

PEG Ratio

Netflix

340

N/A

1.6

Facebook

32

34

1.1

Data source: SEC filings, E*Trade. P/E represents figures from non-GAAP earnings.

Here again, we have a clear winner. Because of the aforementioned spending, Netflix is very expensive based on traditional metrics.

Facebook, on the other hand, looks like a pretty good deal at today's prices. While a P/E of 32 would never be described as "cheap," the company increased earnings by 86% last year, and is expected to grow by 28% moving forward.

Winner = Facebook

The winner is...

So there you have it: While both companies have powerful moats, Facebook has a better balance sheet and appears to be a better value at today's prices. You really can't go wrong by investing in either, but I'm a much stronger fan of Facebook at today's levels. That helps explain why it accounts for 14% of my real-life holdings, while Netflix clocks in at just 2%.