Big technology companies, such as Meta Platforms and Microsoft, are having a horrid time on the stock market this earnings season thanks to the macroeconomic slowdown, but Apple (AAPL 0.64%) dodged a bullet and avoided a big sell-off when on Oct. 27 it released its fiscal 2022 fourth-quarter results (for the three months ended Sept. 24).

The technology giant's revenue and earnings beat Wall Street's estimates despite what Apple's CFO termed  "a challenging and volatile macroeconomic backdrop." The company's revenue was up 8% year over year to $90.1 billion, while adjusted earnings increased 4% to $1.29 per share. Analysts would have settled for $1.27 per share in earnings on $88.7 billion in revenue, but the healthy demand for iPhones, MacBooks, and wearable devices, along with the growth in Apple's services business, helped it post stronger results.

The iPhone moved the needle in a big way for Apple last quarter, and the device is the biggest reason why this tech giant looks worth buying at a time when other big names have fallen by the wayside. Let's see why.

Apple thrives on strong iPhone sales

The iPhone was the driving force behind Apple's growth last quarter. The device produced 47% of the company's revenue and recorded nearly 10% year-over-year growth in revenue to $42.6 billion. That's impressive, considering that the broader smartphone market declined yet again last quarter.

According to Strategy Analytics, global smartphone shipments were down 9% year over year in the third quarter to 297 million units. Apple, however, bucked the trend and sold 49 million iPhones during the quarter, an increase of 6% over the prior-year period. The company's share of the global smartphone market increased to 16.3% as a result.

It is worth noting that Apple's sales increased at a time when its key competitors saw their shipments decline. Samsung's shipments were down 7% year over year. Chinese smartphone OEMs (original equipment manufacturers) such as Xiaomi, Oppo, and Vivo saw their shipments drop 8%, 20.1%, and 20.5%, respectively.

More importantly, Apple enjoyed healthy pricing power last quarter despite inflation and concerns about a potential recession next year. Dividing Apple's total iPhone revenue in fiscal Q4 by Strategy Analytics' shipment estimate points toward an average selling price (ASP) of nearly $879. That's more than double the overall smartphone market's estimated ASP of $413 for 2022, according to IDC.

Apple's solid pricing power isn't surprising. The ASP of 5G smartphones in 2022 is expected to land at $616, so customers are spending more on phones supporting the latest wireless standard. What's more, shipments of 5G smartphones could jump nearly 24% over 2021 to 688 million units and account for 54% of overall shipments, which tells us why Apple is enjoying a mix of healthy pricing and volumes.

The 5G market can supercharge Apple's long-term growth

Apple was the leading 5G smartphone OEM last year with a 31% market share. A similar share in 2022 means that Apple could end up shipping just over 213 million smartphones, based on this year's estimated 5G smartphone shipment forecast of 688 million. As Apple is expected to build 220 million iPhones this year, it could hit that mark as it has a comprehensive 5G smartphone lineup, including the entry-level iPhone SE.

Additionally, customers are willing to pay a premium for Apple's 5G devices, as the company's iPhone ASP indicates. What's more, the stronger demand for Apple's more expensive Pro models is another indication of the company's pricing power at a time when inflation is pulling the overall market down. As such, it won't be surprising to see Apple sustain its dominant position in 5G smartphones.

The good part is that the 5G smartphone market still has a lot of room for growth. IDC estimates that 79% of the smartphones sold in 2026 will support 5G. Based on IDC's forecast of 1.46 billion overall smartphone sales in 2026, annual 5G smartphone shipments could hit 1.15 billion units after four years. If Apple continues to control 30% of the 5G smartphone space in 2026 -- which it could in light of customers' preference for its devices even in the face of macroeconomic headwinds -- its annual iPhone shipments could reach 350 million units.

Multiplying that by an estimated ASP of $850 (assuming Apple needs to lower prices to keep the competition at bay), its annual iPhone revenue could approach $300 billion. That would be a big increase over Apple's iPhone revenue of $205 billion in fiscal 2022, indicating that the company's biggest source of revenue is set to get bigger in the long run.

With Apple trading at 25 times trailing earnings and 6 times sales right now, buying the stock looks like a good idea as these multiples suggest a discount to last year's earnings multiple of 31 and sales multiple of 8. The robust demand for the company's iPhones and its foray into emerging areas such as headsets and even self-driving cars could make Apple a top tech stock in the long run, which is why investors may want to capitalize on its 12% decline in 2022.