Apple (AAPL -0.66%) made headlines today when its stock topped $467.77 per share in intraday trading, becoming the first U.S. public company in history to achieve a market cap of $2 trillion, beating out would-be contenders Amazon and Microsoft, which clocked in at $1.65 trillion and $1.59 trillion, respectively. In order to reach this historic benchmark, Apple stock price has gained more than 59% so far this year, after notching gains of 86% in 2019.

While it may be exciting to see Apple hit another intriguing milestone, it's important to remember that it's completely arbitrary, and while watching the "race to $2 trillion" made for a few good headlines, it has little to do with the ongoing potential of Apple's business. Let's look at what led to the iPhone maker's historic rise and what that means for those thinking of buying or adding shares.

A sheet of $100 bills fresh of the printing press.

Image source: Getty Images.

Like a broken record

It would be hard to note the performance of Apple's stock this year without a nod to the underlying macroeconomic conditions. The pandemic has resulted in near economic chaos, which -- somewhat surprisingly -- the stock market has largely brushed aside. After a precipitous fall in February and March, the major indexes have all largely rebounded. The Dow Jones Industrial Average is down about 2%, the S&P 500 has gained 5%, while the tech-heavy Nasdaq has soundly thrashed both, up 25%.

Investors have rewarded companies with business models that thrived during the stay-at-home orders and the resulting trend toward remote work. Industries including digital payments, streaming music and video, and cloud computing have all held up better than the broader market.

That played to several of Apple's strengths this year, with Apple Pay, Apple Music, Apple TV+, and the App Store all faring better during lockdowns. But the company's strong performance preceded the pandemic, with Apple reporting a record holiday quarter, starting off the year with a bang. Even during the COVID-19-related panic-stricken second quarter, Apple was able to generate growth, with revenue that increased by 1%. For the fiscal third quarter (which ended June 27), Apple produced a third-quarter record, with revenue up 11% year over year, and earnings per share that grew 18%. 

A girl wearing headphones while smiling and dancing.

Image source: Getty Images.

A friend to shareholders everywhere

That's not all. Apple announced that it would increase its dividend by another 6%, marking the eighth such increase in as many years. Since resuming its payout in 2012, Apple's dividend has increased 116%, bringing the quarterly payout to $0.82 per share. It currently yields about 0.71%, though the stock's stellar rise in recent years has weighed on the yield. Apple continues to generate strong earnings, and the company is using just 24% of its profits to support the payout, so these annual increases will likely continue indefinitely.

Apple has also continued its strong record of buying back stock, having reduced its share count by more than 23% over the past five years, and by nearly 35% since 2013.

It isn't just Apple that's buying up its shares. Legendary Berkshire Hathaway (BRK.A 0.61%) (BRK.B 0.79%) CEO Warren Buffett began building a position in Apple over the past several years that now amounts to more than 250 million shares, representing more than 5% of Apple's outstanding stock. The investment has swelled in value to more than $115 billion, accounting for more than 45% of Berkshire Hathaway's investment portfolio. Buffett has said he wouldn't stop there, saying: "We bought about 5% of the company. I'd love to own 100 percent of it." 

Investors could do worse than to follow Buffett's example. Those who bought shares of Berkshire Hathaway in 1964 and held them for the duration would have notched gains of 2,744,062%. 

Six iPhones, each a different color, fanned and splashing through water to show water resistance.

Image source: Apple.

But is Apple stock a buy?

The aforementioned factors that helped to propel Apple's market cap above $2 trillion for the first time are the same ones that will continue to drive the company's future success.

The tech giant's ability to leverage the massive installed base of users to generate strong revenue and income and its shareholder-friendly policies haven't changed, and Apple has additional catalysts going forward. With the ongoing advent of 5G and the continued strong growth of the company's services and wearables businesses, some are predicting that its market cap could go on to eclipse $2.5 trillion in the coming months and years ahead.

This helps to illustrate why Apple is still one of the safest and most compelling investments around -- and its stock is still a buy.