SAN FRANCISCO — At 41 years old, Apple is a respected elder of the tech industry. But rather than easing slowly into retirement, the company is going through another growth spurt.
On Wednesday, Apple's stock surged 5 percent to a record high of $157.14 after it reported surprisingly strong financial results. It is now worth $822 billion, more than any other company in the stock market. And that is before it releases a hotly anticipated new lineup of iPhones this fall, on the 10th anniversary of the original model. Analysts say the new phones could drive sales up by more than 10 percent next year.
Apple is not alone. Other aging tech giants like Microsoft, Amazon and Alphabet, the parent of Google, and younger players like Facebook have also managed to post strong growth despite their tremendous size. The secret to their vigor, according to analysts and investors, is the vast amount of data they have about customers and their ability to sell all sorts of products to those customers.
"This handful of companies is writing the operating system for the new economy," said Brad Slingerlend, lead portfolio manager of Janus Henderson's global technology fund. "The bigger companies are both able to collect data and use that data to build into adjacent businesses."
For Apple, which is far more dependent on hardware sales than other tech leaders, the recent performance is all the more impressive after its dismal 2016, when quarterly revenue fell for the first time in 13 years and the company's sales in China dropped through the floor.
In the most recent quarter, which ended July 1, Apple actually sold 2 percent more iPhones than it did during the same period last year, defying the usual sales slump that occurs before its new phones are introduced. The business in China stabilized.
The iPad, a product line that was collapsing amid the rise of big-screen smartphones, rebounded, with the number of tablets sold increasing 15 percent as Apple cut prices at the low end and added features at the high end. The company's redesigned iMacs and MacBook Pros also gained market share in the slowly declining personal computer industry.
In a harbinger of the company's future, digital services — the App Store, iCloud, movie and music downloads, and the Apple Music streaming service — have become the second most important category for the company, growing 22 percent to $7.3 billion in the quarter. With 1.2 billion iPhones sold and millions of new customers joining the iPhone ecosystem each year, Apple is in a position to increase its income from services much faster than from accessories like the Watch.
"Wall Street is waking up to the reality that the next great product might not be an Apple car or the TV or the Watch," said Trip Miller of Gullane Capital Partners, which loaded up on Apple shares when they were below $100. "The services business is the next great product."
Mr. Miller, who also owns stock in Alphabet and Amazon, said that part of what makes these companies so powerful is their strong balance sheets, with seemingly limitless cash and borrowing capacity. That has allowed Alphabet to slowly build YouTube's advertising business and move into self-driving cars.
Even Facebook, which could sell more ads on its social network than it is willing to put into the news feed, is generating so much cash that it can afford to slowly increase ads on Instagram and its Messenger network while absorbing losses from its Oculus virtual reality business.
Apple's sales have tended to be more cyclical, with big upgrades to its iPhones typically occurring every two years. The company is a year behind schedule this time, with its last major update in 2014. That has investors excited about the potential for a large spike in demand when the new phones come out this fall.
"Any product they release this year would be successful. There is pent-up replacement demand," said Amit Daryanani, a hardware analyst with RBC Capital Markets. "Most of us are modeling 11 to 12 percent revenue growth in 2018, a super cycle."
But he said such growth is unlikely to continue in 2019, when excitement about the new iPhones has faded.
Still, Apple's financial heft is likely to get it through any rough patches. It had $45 billion in revenue last quarter and is now sitting on $262 billion in cash and marketable securities.
The risk is that customers decide to move on from the decade-old iPhone. Apple's new high-end phone, for example, is expected to cost more than $1,000, which could turn many away. And a technical flaw, like the burning batteries in Samsung's Note 7 phones last year, could prompt a costly recall.
"If that happened to the iPhone, that would be devastating," Mr. Slingerlend said.