Apple (AAPL 3.15%) crossed a $3 trillion market capitalization on Tuesday, following a surge in the tech company's stock price this year. The iPhone maker's shares are up about 49% year to date, crushing the S&P 500's 19% gain over this same period.

With such a staggering rise, many shareholders are likely revisiting their investment theses on Apple shares. Now trading at more than 31x earnings, is the tech stock worth its premium valuation? Or is it time to move on, looking for a better place to invest capital?

Though you might imagine shares being overvalued after such an astronomical gain, there's actually good reason to continue holding.

There's more than meets the eye

On the surface, it may be difficult to understand why Apple stock is attracting so much interest from investors this year. After all, revenue fell 3% year over year during fiscal 2023 (the fiscal year ended Sept. 23). This compares to 8% top-line growth in fiscal 2022. But there's more to the story.

First, Apple's financial results in fiscal 2023 were weighed down heavily by foreign-exchange headwinds. In the first, second, third, and fourth quarters of fiscal 2023, the negative impact on Apple's reported year-over-year growth rates was 800, 500, 400, and 200 basis points, respectively. In other words, Apple's momentum with customers is better than its reported revenue figures make it out to be.

Second, Apple's revenue trends improved throughout fiscal 2023. Total revenue fell 4% year over year during the fiscal year's first half and just 1% in the second half.

Finally, Apple's important high-margin services segment has recently seen accelerated momentum, growing an impressive 16% year over year in fiscal Q4. With approximately double the gross profit margin of its hardware sales, this key segment's strong growth played a big role in Apple's 13% year-over-year earnings-per-share growth during the period. By growing earnings so nicely despite a challenging environment, Apple is showing Wall Street its resilience.

Looking ahead

Steadily improving business trends and a promising high-margin services segment is great, but are they enough to justify a price-to-earnings multiple of more than 31? With this final point, I believe so.

This icing on the cake for Apple investors is management's recent guidance. For fiscal Q1, Apple guided for flat revenue, compared to the year-ago quarter. This occurred despite having one less week than in the same quarter of last year and in the face of foreign-exchange headwinds that are expected to pressure the company's top line by about 100 basis points. With the extra week in the year-ago quarter accounting for 7 percentage points of the period's revenue, Apple's guidance for flat revenue growth, despite such a tough comparison, shows that it's clearly entering growth mode as it rolls into fiscal 2024.

So, is Apple stock a buy, sell, or hold today? Saying it's a buy is getting tougher at this level, but it's at least a hold. Of course, there are always risks to owning stocks, so Apple's attractiveness as an investment could change.

Investors will have to watch the company closely. Overall, however, Apple's current valuation seems reasonable, relative to its business fundamentals.