If you had invested $10,000 in Realty Income (O 0.24%) 20 years ago, those shares would be worth around $40,000 today. That's not bad, but it falls short of the $47,500 you'd have had if you'd invested in an S&P 500 index fund instead. Only this comparison lacks context in a very important way. Here's why Realty Income was a much better investment than the S&P 500 over the last two decades.

Looking at the total picture

Realty Income is a real estate investment trust (REIT), a corporate structure designed to pass income on to shareholders. REITs were basically created to allow small investors the opportunity to benefit from the cash flows generated by institutional-level properties. So long as a REIT pays out 90% of its taxable income as dividends, it pays no income taxes. Though that means that shareholders have to pay taxes on the dividends as if they had earned income, that income avoids double taxation. All of these REIT basics are a way to highlight the fact that when you talk about REITs, you have to consider the dividend angle, or you aren't really thinking about the full picture.

Person giving the thumbs-up sign and holding a drink while floating in an inner tube in a pool.

Image source: Getty Images.

So, the $10,000 investment noted above that grew to $40,000 over two decades is only half the story. If you look at total return, which assumes that all of the dividends received get reinvested, the value of that $10,000 actually grows to $116,500. That is not a typo. An S&P 500 index fund with dividends reinvested would have turned the original $10,000 into just under $70,000. 

Step back from the specific numbers for one moment. Reinvesting the dividends Realty Income paid over the past 20 years would have nearly tripled the total value of an investor's position. That is the incredible power of compounding on full display.

O Chart

O data by YCharts

The leader of the pack

Realty Income is no run-of-the-mill REIT. It has for years been a leading player in the net lease niche, which basically means that lessees are responsible for most property-level operating costs. Today, Realty Income is the largest company in the space, with a portfolio of over 11,700 properties and a $43 billion market cap. Add in an investment-grade balance sheet, and you can see why dividend investors might like the stock.

That said, the dividend growth here has been fairly modest over time, rising in the low- to mid-single digits. So Realty Income is really a tortoise, but one that has an incredible record of consistency behind it. The monthly dividend has been increased annually for 27 consecutive years. Slow and steady is the driving mantra, and it has clearly proven to be a very successful one. The REIT has shown no sign that it wants to shift to a different playbook.

There is one caveat. REITs in general have become far more mainstream over the past couple of decades. At the beginning of that time frame, dividend yields were generally higher. In other words, buying today may not lead to quite as strong performance over the next 20 years. But if you are a dividend investor, don't overlook Realty Income just because there are other REITs with a yield higher than the 4.6% on offer here. There are times when it pays to focus on quality, and this is one of them.

More boredom ahead (unless you find solid long-term returns exciting)

Realty Income is not going to excite you. The current yield isn't particularly generous compared to the REIT's own history or to its peers. But if what you want is a dividend you can count on, the impressive total return performance of Realty Income shows out how slow and steady can win the investing race. This shouldn't be your only investment, of course, but it can be a valuable cornerstone holding on which you build a diversified income portfolio.