When Apple announced its most recent earnings, the big surprise was the performance of a product which, while once synonymous with the whole company, had become a footnote to many: The Mac.

In fact, Mac sales in the quarter ended Sept. 30 were so strong that the venerable computer brand reached its best market share since 1995, and logged an 18 percent growth in revenue from the same quarter last year.

But, while the size of the quarterly jump was unexpected, nobody who has been paying attention should have been shocked. If you just look around you, at least in the U.S., it’s hard to miss the fact that the Mac has been on the rise for years. Whether at the office, at a coffee shop, a college campus, an airport or a conference, Macs seem to be everywhere today.

And for those of us who were around tech in the late 1990s, that’s pretty remarkable. Back then, the Mac had fallen far behind Windows machines, especially in software, and seemed doomed. People who used them were few and far between, and were viewed as, well, strange. Spotting a Mac in the wild was like spotting a rare bird.

In fact, in July 1997, just days after Steve Jobs became CEO to once again lead the company he co-founded, I wrote a column for the Wall Street Journal that said: “… unless you’re emotionally devoted to the Mac, or are in a particular business or school market where the Mac’s advantages and specialized software make it a compelling choice, I can’t honestly advise you to buy another.”

Now I believe it’s the best line of computers on the market, and I consider one model in particular — the thin, light and rugged MacBook Air — to be the best consumer laptop ever made.

In short, the Macintosh computer, like Apple itself, stands as a stark contradiction to the idea that there are no second acts in American life.

The Mac’s rebound has its limits. Its sales are still dwarfed by those of Windows computers, partly because it’s a premium-priced machine. The least-expensive full-featured Mac, the 11-inch MacBook Air, starts at $899. By contrast, you can get an acceptable, full-featured Windows PC for $300 to $600.

And Apple today isn’t mainly a Mac maker. Its principal product is the iPhone, which accounts for the vast majority of its revenue and profits, and of its public identity.

The Mac is a $24 billion annual business, which is quite large by most standards. But the iPhone was a $102 billion business in fiscal 2014, both up 12 percent from the prior year.

Still, the rebirth of the Mac has been amazing, especially among younger users, tech-savvy people, and influential groups like journalists and public figures. If, like me, you do a lot of public speaking, it’s not unusual to look out over an audience and see rows and rows of glowing Apple icons on the upturned lids of laptops, and only a handful of Windows PCs.

As the computer market has gone through its worst stretch ever, with sales in recent years flat or declining, the Mac has been the exception. Apple says it has gained market share for 33 of the last 34 quarters.

That doesn’t mean that the majority of computers around are Macs. Far from it. But even walking into a room and noticing that, say, a third of the laptops are Macs, is a sight that I, and many others, wouldn’t have thought possible 17 years ago.

Apple reported that, for its fiscal fourth quarter ending Sept. 27, it sold 5.5 million Macs, up from about 4.4 million in the year-ago quarter. Analyst firm IDC says Apple took 6.9 percent of the worldwide PC market, becoming the No. 5 vendor globally. And it reached 13.4 percent of the U.S. market, becoming the third-biggest-selling computer line here. That’s well below Hewlett-Packard, at 28 percent, and Dell, at 24 percent, but a triumph for a computer for which consumers typically spend more than $1,000.

Interestingly, considering its high price, Apple claimed that Mac sales were especially strong in emerging markets.

Contrast that with the situation in December 1997, when CNET reported IDC figures showing that Apple had sunk to eighth place from fifth worldwide, and to ninth place from fifth in the U.S. Worldwide sales had plummeted 31 percent, while the PC market as a whole had risen 16 percent.

“The Mac is still really important to us,” said Phil Schiller, Apple’s senior vice president of Worldwide Marketing. “Yes, we care about iPhones and iPads, and the new Apple Watch. But we care about the Mac just as much.”

I attribute the rebirth of the Mac to three main factors: Steve Jobs, the Internet, and blunders by Microsoft.

Jobs saved the Mac in several ways. First, he cut most of the confusing plethora of Mac models, killed non-Mac products like the Newton and printers, and focused on building just one good laptop and desktop for consumers, and one good laptop and desktop for “pro” users, like graphic designers.

Second, he replaced the Mac’s by-then-antiquated operating system with a modern, powerful software platform called OS X, which is still in use. This move allowed the Mac to compete head to head with Windows, which had become polished and powerful.

Third, he drastically overhauled the hardware, introducing the iMac and MacBook lines, which were hits that were widely emulated throughout the industry.

Fourth, he moved the Mac to standard Intel processors, so the computer could gain new power and features from the chip leader’s prodigious research and development.

Fifth, beginning in 2001, he opened the highly successful global chain of Apple retail stores, which showcased the Mac and introduced it to buyers of Apple’s other products. Before that, Macs had often been tucked into the back shelves of computer retailers.

Finally, while preserving its distinctiveness, he made the Mac more compatible with the Windows world. He scrapped the computer’s oddball ports and connectors for standard ones, like USB. He altered the software so it could recognize Windows file extensions. And, once the switch to Intel was made, he introduced Boot Camp, a free feature that allowed Macs to run Windows, to give customers confidence they’d still be able to run some crucial Windows program when they needed it.

The Internet also played a big part in the Mac’s revival. After years of neglect and falling sales, many third-party software vendors had stopped making programs for the Mac and focused exclusively on Windows. But as users turned increasingly to the Web as their main activity on computers, the Mac suddenly became an equal. Apple introduced its own browser, Safari; and Google’s popular Chrome browser, and others, run great on Macs.

Finally, Microsoft helped. In the very beginning of the second Jobs era, it lent Apple money to stay afloat, for complex reasons that included, in part, the belief that the Mac would never be any real threat. Much more importantly, two of its last three versions of Windows — Vista and the current Windows 8 — have proved unpopular with consumers, making the Mac a more attractive alternative. In fact, Windows 8, which works best with costly touchscreens, has helped push the price of the sleekest Windows laptops into Mac territory, erasing some of the Windows PC’s price advantage.

This past quarter of huge gains for the Mac may be a fluke. And the Apple computer will never, I suspect, be the world’s biggest seller. But for years now — well before this last blockbuster quarter — it has been pulling off a resurrection few would have expected in the dark days of the late ’90s.