Apple (AAPL 1.27%) is worth just over $3 trillion as of this writing, and it's routinely among the most valuable companies in the world. Much of that success is owed to its world-class brand and customer loyalty, intangible assets that have helped Apple become one of the most profitable companies in the world too.

But the business isn't foolproof, and its revenue has declined in each of the past four quarters. Even the stock's gains have been lackluster of late with shares rising just 1% in the past six months. Investors appear to be growing concerned about the stock, especially given its elevated valuation.

There is, however, a bright spot for the business: its services segment.

Revenue from services helped offset declining product sales last year

In Apple's most recent fiscal year, which ended Sept. 30, 2023, the company reported net revenue of $382.3 billion, down just under 3% from the previous year.

But that doesn't tell the whole story because product sales drove that decline, while the services segment grew 9% to $85.2 billion. Go back two years, and services revenue is up 25%.

This latest fiscal year, services accounted for a record 22.2% of the top line, extending a yearslong trend that paints a bullish picture for shareholders.

Services could be a much more important part of Apple's business in the future

There are more than 2 billion Apple devices in use by consumers worldwide. Even if consumers slow the pace at which they upgrade their iPhones and MacBooks, the company can still offer them services like Apple TV+, Apple Music, Apple Arcade, and Apple Fitness+, not to mention whatever else the company might roll out in the future.

It's a huge opportunity for the company to further diversify its top line and become less reliant on hardware sales. A strong backbone of services also keeps users entrenched in Apple's ecosystem, making it harder for them to switch to other platforms.

And while having 2 billion devices already in consumers' hands can be an obstacle to steadily growing product revenue, it's a huge opportunity for the company to upsell users on services. In that process, the company's profit margins will also benefit as the services segment boasted a 70.8% gross margin in fiscal 2023, nearly double the 36.5% margin on products.

It might not be too late to invest in Apple

Trading at nearly 32 times trailing earnings, Apple stock is far from cheap. That premium is arguably deserved though for a company with this kind of reach and almost $100 billion in annual free cash flow. As services make up a growing share of the business, they can increasingly offset the ebbs and flows on the hardware side.

The stock has taken a break from its impressive gains in recent years, but Apple's long-term trajectory remains promising. Investors have plenty of reasons to stay bullish on this tech giant.