Some people underestimate the power that dividends can have over time; whether you invest your dividends or not can make a massive difference in the total returns from a stock like U.S. telecom giant AT&T (T 1.88%).

Had you invested in AT&T in 2000, the difference between tracking the S&P 500 and failing miserably all comes down to what you did with those quarterly checks. I'll show you the numbers behind AT&T's past 23 years in the market and investigate whether you can count on AT&T's dividend over the coming years.

AT&T's price action has disappointed for years

Investors focused on price returns didn't get much from AT&T over the years; a $10,000 investment made in 2000 would be worth just $5,775 today. That performance is even more infuriating when considering the S&P 500 would have nearly tripled your money instead.

So what went wrong? Well, two things, primarily. First, AT&T has made some big mistakes over the years. It spent much of the past decade spending billions on expensive mergers to get into pay television first and then streaming. It only recently washed its hands of those ventures when it spun off its Time Warner assets in a deal with Discovery to form Warner Bros. Discovery.

T Chart.

T data by YCharts.

Secondly, AT&T isn't a fast-growing company; mostly everyone in the United States has a smartphone. Users tend to bounce back and forth between carriers, making the industry very competitive. Additionally, AT&T spends billions each year upgrading and maintaining its wireless network. Growing profits in a competitive industry that requires constant investments can be tough. Analysts believe AT&T's earnings-per-share (EPS) will increase by an average of just 3.3% annually over the next several years.

But that dividend makes a huge difference

Now, total returns are a different story; that same $10,000 investment would be worth $27,780 today, nearly triple your initial investment. It still falls short of the S&P 500, but that's a nearly fivefold difference in returns -- all because of dividends. 

T Total Return Level Chart.

T Total Return Level data by YCharts.

Reinvesting dividends can turn on the turbo jets of compounding. Remember, reinvesting dividends buys you more shares, which pay their own dividends. You're slowly building a more significant income stream every year that you reinvest. Eventually, that snowball can turn into a boulder of cash that rolls downhill in your favor.

Ideally, a stock will at least keep pace with the broader market. Some say that a company's fundamentals will dictate the story over time, and it's clear that AT&T has fallen short of a good story these past 23 years.

What does AT&T offer moving forward?

But that doesn't mean that investors should run from shares today. You can see below that the stock's price-to-earnings ratio (P/E) is less than half what AT&T has averaged over the past 23 years. Even with a modest growth outlook, investors have a margin of safety because they can buy shares so cheaply today.

T PE Ratio Chart.

T PE Ratio data by YCharts.

The low valuation helps dividend investors, too; the stock's current dividend yield is just over 6%. While that's not quite its long-term average, remember that management cut the dividend in 2022 to help free up more cash for the business. Now, investors have a safer dividend with a manageable 50% dividend payout ratio based on management's guided free cash flow for 2023.

AT&T stock might not be for everyone, but its attractive price and dividend should at least make it one worth considering. Be sure to reinvest those dividends if you own shares; they make a massive difference over time.