Warren Buffett loves Apple (AAPL 0.58%) stock, which is evident from Berkshire Hathaway's massive position in the tech giant that's famous for its iPhones, iPads, and MacBooks.

Apple accounted for 41% of Berkshire's portfolio at the end of July 2022. A closer look at the iPhone maker's latest results will tell us why Buffett has bet big on Apple, and we'll also take a look at the reasons why the stock remains an enticing bet right now.

Apple stands tall despite headwinds

Apple released its fiscal 2022 third-quarter results (for the three months ended June 25, 2022) on July 28. The technology bellwether posted record quarterly revenue of $83 billion, an increase of 2% over the prior-year period. Adjusted earnings came in at $1.20 per share.

Wall Street would have been happy with $1.16 per share in earnings on $82.8 billion in sales. Apple, however, edged past those expectations thanks to the healthy demand for its products in emerging markets such as Indonesia, Vietnam, and Brazil. What's more, Apple's revenue in India nearly doubled last quarter.

Additionally, the supply chain constraints that Apple was anticipating were less severe during the quarter. All these factors helped Apple increase its iPhone revenue slightly during the quarter to $40.7 billion, up nearly 3% from the prior-year period. It is impressive to see Apple increase its iPhone revenue at a time when global smartphone sales collapsed.

According to Strategy Analytics, smartphone shipments fell 7.3% year over year in the second quarter of 2022 to 291.2 million units. But Apple's shipments increased 3.3% over the year-ago quarter to 47.5 million units, making it the second-largest smartphone vendor with a market share of 16.3%. It is worth noting that Apple's Chinese rivals such as Xiaomi, Oppo, and Vivo lost significant ground during the quarter, with their shipments declining 25%, 26%, and 21%, respectively.

Strategy Analytics' shipment figures suggest that Apple's iPhone average selling price (ASP) stood at $856 last quarter. That's impressive considering that smartphone ASP is expected to land at $402 in 2022, according to market research firm IDC. Apple's pricing power suggests that iPhone demand remains robust despite factors such as inflation, supply chain problems, and the weakness in the smartphone space on account of dipping demand.

The secret sauce that's driving iPhone sales growth

One key reason why iPhone sales are growing is because of Apple's dominance in the 5G smartphone market and a massive base of users that are in an upgrade window. What's more, Apple's move to diversify its iPhone line-up with the inclusion of a budget-friendly 5G iPhone SE is working in the company's favor. The company gained market share in Europe last quarter thanks to the latest iPhone SE on the back of a 3% increase in shipments, while the overall market was down 11% over the prior-year quarter.

All this indicates that Apple is able to attract Android users into the iOS ecosystem in the 5G smartphone era. This bodes well for the company's future. That's because 5G smartphones are expected to account for 53% of the industry's shipments this year, according to IDC. The market research firm estimates that 700 million 5G smartphones could be shipped this year, up 25% from 2021.

By 2026, IDC says 5G devices will account for 78% of overall smartphone shipments of 1.41 billion units. So, just over a billion 5G smartphones could be shipped in 2026. Apple dominated the 5G smartphone market with a 31% share in 2021.

If Apple continues to hold such an impressive share of 5G smartphones in 2026, which it seems capable of doing, its annual iPhone shipments could exceed 310 million units in four years. That would be a 32% jump over 2021's iPhone shipments of 235.7 million units. Throw in Apple's solid pricing power, and it is easy to see why the company's largest source of revenue is built for long-term growth.

Consider buying before it is too late

Apple stock has gained 15% in the past month. The company's resilient performance last quarter and room for growth in the 5G smartphone market suggest that it can sustain its rally for a long time to come.

That's why investors who haven't bought this Buffett favorite yet should consider doing so, as Apple stock is still available at an attractive valuation. Trading at 26 times trailing earnings, Apple is cheaper than its last year's earnings multiple of 31.6. Analysts expect the company's bottom line to grow at an annual rate of nearly 10% for the next five years, but it won't be surprising to see Apple do better thanks to the emergence of new growth drivers.

As such, investors looking to buy a top tech stock for the long haul are getting a good deal on Apple right now, and they should consider grabbing this opportunity before shares become more expensive.