Layoffs have hit the tech industry hard—except at Apple Inc.

The world’s largest company has so far avoided the job cuts rippling through peers including Microsoft Corp. , Google, Meta Platforms Inc. and Amazon.com Inc.

No company is certain to avoid significant cutbacks in an economic environment as volatile as the current one, and Apple isn’t immune to the business challenges that have hit other tech giants. It is expected next month to report its first quarterly sales decline in more than three years. Apple has also slowed hiring in some areas.

But the iPhone maker has been better positioned than many rivals to date in part because it added employees at a much slower clip than those companies during the pandemic. It also tends to run lean, with limited employee perks and businesses focused on hardware products and sales that have so far largely dodged the economic downturn, investors say.

An Apple spokesman declined to comment.

From its fiscal year-end in September 2019 to September 2022, Apple’s workforce grew by about 20% to approximately 164,000 full-time employees. Meanwhile, over roughly the same period, the employee count at Amazon doubled, Microsoft’s rose 53%, Google parent Alphabet Inc.’s increased 57% and Facebook owner Meta’s ballooned 94%.

Apple has about 65,000 retail employees working in more than 500 stores who make up roughly 40% of the company’s total workforce.

On Friday, Alphabet became the latest tech company to announce widespread layoffs, with a plan to eliminate roughly 12,000 jobs, the company’s largest-ever round of job cuts.

Alphabet’s cut follows a wave of large layoffs at Amazon, Microsoft and Meta. The tech industry has seen more than 200,000 layoffs since the start of 2022, according to Layoffs.fyi, a website that tracks cuts in the sector as they surface in media reports and company releases.

The last big round of layoffs at Apple happened way back in 1997, when co-founder Steve Jobs

returned to the company, which then cut costs by firing 4,100 employees.

So far, Apple’s core business has shown itself to be resilient against broader downturns in the market. The other four tech giants have suffered amid slowdowns in digital advertising, e-commerce and PCs. In its September quarter, Apple reported that sales at its most important business—the iPhone—advanced 9.7% from the previous year to $42.6 billion, surpassing analyst estimates.

Apple may face a rougher December quarter, which it is scheduled to report on Feb. 2, as the company encountered manufacturing challenges in China, where strict zero-Covid policies damped much economic activity. Many analysts expect that demand hasn’t subsided for its iPhones and as the company continues to ramp back up manufacturing, demand is anticipated to move to the March quarter.

The company’s business model hasn’t been totally immune to broader slowdowns. Revenue from its services business continued to slow, growing 5% annually to $19.2 billion in the September quarter, shy of the gains posted in recent quarters.

Tom Forte, senior research analyst at investment bank D.A. Davidson & Co., said he expects Apple to reduce head count, but it might do that quietly through employee attrition—by not replacing workers who leave. The company could move in the direction of making other cuts or adjustments to perks that are common in Silicon Valley. Apple doesn’t offer free lunches to employees on its corporate campus, unlike other big tech companies such as Google and Meta.

Some of the tech giants cutting jobs have spent heavily on projects that are unlikely to turn into strong businesses anytime soon, said Daniel Morgan, a senior portfolio manager at Synovus Trust Co., which counts Apple among its largest holdings. “Both Meta and Google are terribly guilty of that,” he said.

Meta has been pouring billions of dollars into its Reality Labs for its new ambitions in the so-called metaverse. Meta Chief Executive Mark Zuckerberg has defended the company’s spending on Reality Labs, suggesting that virtual reality will become an important technological platform.

After announcing the layoffs, Alphabet Chief Executive Sundar Pichai said the company had seen dramatic periods of growth during the past two years. “To match and fuel that growth, we hired for a different economic reality than the one we face today,” he wrote in a message to employees on Friday.

Apple also is working on risky future bets, such as an augmented-reality headset due out later this year and a car project whose release date is uncertain, but at a more measured pace.

Write to Aaron Tilley at aaron.tilley@wsj.com