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.”