Opening an account to save for retirement can be one of the most beneficial financial decisions a person ever makes. If you qualify for a Roth IRA -- the kind that offers tax-free compounding and withdrawals at retirement -- it's one of the easiest ways to build wealth you can find. 

Many say the best stocks to buy in these accounts are the ones that could skyrocket higher or those paying big dividends. It makes sense. If you don't have to pay taxes on the gains, why not hold the stocks that offer the biggest potential? That said, companies like Apple (AAPL -0.05%) that produce outsized returns for shareholders through both dividends and share buybacks shouldn't be overlooked. Simple math highlights how investors shouldn't overlook the tech giant for their tax-advantaged account.

A person sitting at a table eating an apple while looking at his smartphone.

Image source: Getty Images.

Moving beyond iDevices

Apple has a reputation for being an innovator. But there were portable music players, smart phones, and tablet computers even before its well-known products. What has been most revolutionary is how the company was able to drastically improve the user experience and weave the products into an ecosystem. For its customers, those products are now everywhere they turn as they live their lives -- and they are all integrated with each other.

With the installed base of devices, Apple has expertly moved into services offerings. In addition to the App Store, products like iCloud, Apple Music, and Apple Pay make it easier and easier for customers to spend more money with the company. In fact, services made up 18.5% of total revenue over the past 12 months. That number was only 11% in 2016. The higher mix of services isn't because product revenue is stagnating. Far from it.

The strength of the ecosystem

Since 2016, overall revenue has climbed almost 51%. iPhone, iMac, and iPad have all grown respectably. The services category has impressed, with 147% growth. However, it's the wearables category that has grown the fastest. Sales in that segment are up 216%, going from $11 billion to $35 billion over that time.

Growth in those categories is important because the wearables and services make the devices much stickier -- customers are less likely to switch. In essence, it makes buying an Apple device a lifestyle choice instead of just a transaction. The continued success has allowed the company to give a lot of money back to shareholders. It's that capital return program that makes the stock a great fit for a tax-advantaged Roth IRA.

Total returns tell the whole story

Since 2013, Apple has returned more than $440 billion to shareholders. It has come in the form of both dividends and share repurchases. During that time, the dividend has grown from $0.41 in 2013 to a projected $0.88 over the next year. The total number of shares outstanding is down 34% since 2013. Those are big boosts to shareholder gains that could compound tax-free in a Roth IRA.

Doing the math for someone planning to retire in 30 years, the share buybacks plus dividends (when reinvested) turns an initial $6,000 investment into $22,000. That's without any increases in the size of the company. Make that same investment every year and the account grows to almost $400,000 -- again, without Apple actually getting any bigger.

Year Shares Outstanding Dividend per Share Portfolio Value
2021 17.2 billion $0.88 $6,000
2030 12.4 billion $1.67 $87,500
2040 9.0 billion $3.16 $205,000
2050 6.5 billion $5.99 $399,000

Data source: Author's calculations.

That's a life-changing result. It's easy to look past an enormous company stealthily returning capital to shareholders when picking a stock for your retirement account. Conventional wisdom of a big dividend payer or speculative stock with huge potential returns makes sense. However, it's important to remember that the purpose of the account is to build wealth that doesn't get taxed. From that perspective, Apple might just be a great stock for your Roth IRA.