The wealth-building power of compound interest will never cease to amaze me.

It's a story of patience and attention to detail, where small differences in short timescales add up to massive divergence over decades. In the end, the biggest winners don't always deliver the fattest share-price returns.

Consider the case of diversified energy guru Exelon (EXC -0.90%). The stock has seen its share of ups and downs over the years, but has underperformed the Dow Jones Industrial Average (^DJI 0.40%) index in the long term.

^DJI Chart

^DJI data by YCharts.

But the story changes dramatically once you take Exelon's generous dividend history into consideration. The company hasn't always been a model of dividend aristocracy, but Exelon nevertheless shares an impressive amount of wealth directly with its shareholders. Right now, Exelon's 6.7% yield is richer than every single one of the Dow's 30 high-class dividend payers.

EXC Dividend Chart

EXC Dividend data by YCharts.

These payouts have made a massive difference to total returns on your investment. If you reinvested every penny of Exelon's dividends into more shares, you'd be crushing the Dow by a wide margin.

^DJI Chart

^DJI data by YCharts.

There are other reasons to invest in Exelon over traditional oil-based energy stocks, too.

Oil-focused investments have been outperforming Exelon in recent years, but the tide may turn again. In fact, I'm pretty sure it will. You see, Exelon is among the nation's largest providers of green energy, including a major investment in nuclear power plants.

At the moment, Exelon's yield is artificially high and share prices too low because investors worry about a long-term slump in natural gas prices. The same dynamics cause the exact opposite effect on natural gas producers, since Exelon is on the consumer's side of the equation. That's why Exelon shares look so cheap these days while ExxonMobil (XOM -2.78%) and Chevron (CVX 0.37%) command premium prices -- but subpar dividends, historically speaking.

If you're looking for a solid large-cap dividend play today, all of these facts would suggest that you should skip over the expensive Dow components I just mentioned but dig deeper into Exelon instead. You don't have to drill for oil and gas to be a solid cash machine in the energy sector.