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, short-term differences add up to massive differences over decades. And in the end, the biggest winners don't always deliver the fattest share-price returns.

Let's dive into PepsiCo (PEP -0.26%) today. The soft-drink and snack foods giant has been paying quarterly dividends since 1977 and has raised the payout 12 times in the last 10 years.

PEP Dividend Chart

PEP Dividend data by YCharts.

Archrival Coca-Cola (KO 0.14%) may have a longer dividend history, but Pepsi puts up a spirited fight when it comes to payout increases:

PEP Dividend Chart

PEP Dividend data by YCharts

Looking in the rear view mirror, both soda stocks have traded fairly close to the Dow Jones Industrial Average's (^DJI 0.52%) mood swings since 2003. Coca-Cola is a longtime member of that august index, while Pepsi is not, but that hasn't stopped the stocks from trading like twins.

PEP Chart

PEP data by YCharts.

But those are straight-up share-price moves. What happens if we account for dividend reinvestments along the way, using the SPDR Dow Jones (DIA 0.51%) exchange-traded fund as a dividend-powered proxy for the Dow? Really only one thing: Both Pepsi and Coke pull away from the Dow.

PEP Total Return Price Chart

PEP Total Return Price data by YCharts.

If you invested $1,000 in each of these stocks 10 years ago, both would have rewarded you richly for reinvesting their dividends along the way. Pepsi shares would be worth $667 more on their own, or $1,136 more on a DRIP plan -- a difference of $469. For Coca-Cola, a $711 gain turns into a $1,258 return where the dividends activated $547 of your total gains.

Just pocketing Pepsi's dividend checks was far less helpful than running a DRIP plan. Pepsi's actual dividend payments in the last 10 years add up to $15.82 per share, or $326 for the 20.6 shares in our hypothetical $1,000 investment. The simple act of automatically buying more Pepsi shares instead of cashing the checks made a 44% difference to the value of your dividends.

Meanwhile, Coca-Cola's payouts totaled $14.11 per share or $633 on a $1,000 investment made 10 years ago. Yes, that's actually 16% more than the $547 extra value that was unlocked via Coke's DRIP plan. Over this particular 10-year span, the Coca-Cola stock's price swings and dividend dates just haven't worked out in favor of DRIP investors. Them's the breaks. DRIP investing tends to outperform the combination of share price gains and cashed-out dividend checks in the long run, but there are no magic bullets in investing.

Looking ahead, Pepsi seems to have more headroom for further dividend growth than its Dow-bound counterpart. Coca-Cola currently spends 59% of its free cash flows on dividend checks while Pepsi's cash dividend ratio sits at a more comfortable 44%. This tidbit plus Pepsi's more generous dividend boosts in recent history add up to a more attractive income-generating play in this Fool's opinion.

I'll note that both Pepsi and Coca-Cola are longtime recommendations from our own Income Investor newsletter, but both stocks get a "hold" rating because income expert James Early can think of several stronger dividend plays right now. Find out more with a free 30-day subscription to Income Investor, or to any other Foolish newsletter service.