When Apple hired Angela Ahrendts, a fashion executive, to lead its retail strategy, the company gave her one of the biggest compensation packages in Silicon Valley and a mandate to transform its Apple stores.

For Ahrendts, it wasn't just about selling iPhones.

“Retail is not dying,” she said at the Cannes Lions advertising festival last year, but stores have to serve a bigger purpose than “just selling things,” she advised.

The problem is, Apple is no longer selling as many iPhones as it would like. In a surprise move on Tuesday, Apple announced Ahrendts will leave in April for “new personal and professional pursuits.”

It's clear Apple appreciates Ahrendts. By the time she leaves the company, she will have made more than $170 million as their retail chief. Last year, Ahrendts made $26.5 million, according to Apple’s regulatory filing. By comparison, Apple's own Chief Executive Officer Tim Cook made $15.6 million, and Microsoft CEO Satya Nadella made just under $26 million last year.

Her departure comes as Apple is facing perhaps its toughest test yet during the Tim Cook era, as iPhone sales have slowed and Apple has struggled to make an imprint on the Chinese market.

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

"Her background as CEO of Burberry and the last five years at Apple established Ahrendts as one of the most respected retail visionaries and executives around," said Daniel Ives, managing director of equity research at Wedbush securities. "She was clearly an asset for Cupertino, especially as the company was looking to innovate the design and vibe of its flagship Apple retail stores around the world."

So what did Apple get for that?

Apple’s sleek, minimalist, glass-enshrined stores have long been holy places for Apple diehards, and expanded to 506 retail locations on five continents during Ahrendt’s tenure.

As the former chief executive of Burberry, Ahrendts was expected to be the face of Apple, but instead quietly worked in the background, carefully choosing her media appearances and staying out of the spotlight most of the time at the company’s semi-annual press events.

Ahrendts made her first on-stage appearance at Apple’s annual iPhone event in September 2017, where she called retail Apple’s “largest product” and shared how she envisioned the stores becoming “town squares” with plenty of green space, where people come together to hang out, learn new skills and, oh, buy the new $1,000 iPhone.

In an effort to get people to think of Apple products as part of a lifestyle, Ahrendts also spearheaded free “Today at Apple” courses, which launched in 2017. Apple continues to launch new sessions, including coding classes, software lessons and walking tours, where people can learn how to use the Apple Watch for fitness or how to shoot cinematic photos. Apple said it has held more than 18,000 free sessions since the launch and has reached millions of people.

During her tenure, Ahrendts also introduced more practical shopping functions that customers have come to expect from retailers, including the option to buy online and pick up in-store; and text message alerts, so people don’t have to linger waiting for an appointment at the Genius Bar.

While Ahrendts has made some changes to the Apple retail experience, her departure comes after a rough few months at the company. Apple became a trillion-dollar company last year, before the stock took a tumble in November and lost more than $200 billion in value.

Apple does not break out retail store sales in its earnings report, so it’s hard to say whether traffic to stores is down. The Genius Bar is lumped into Apple’s growing “services,” category, which continues to be a rare bright spot for the company.

While the news about Ahrendts' exit came as a surprise to investors, Ives said a shake-up at Apple could be a positive start to correct course.

“In a nutshell, while the timing of this departure is a head scratcher, change could be a good thing for Apple -- as the last year has been nothing to write home about," he said.