Shares of Cirrus Logic (NASDAQ:CRUS) missed the broad market rally in 2013, where the S&P 500 zoomed 29% higher. Instead, Cirrus investors saw their shares tumble 29% lower. Here's why.

You can't tell Cirrus' story without talking about Apple (NASDAQ:AAPL) as well. Cirrus provides audio processors and amplifier chips to the entire Apple portfolio from iMac desktops to iPads and iPhones. Hence, Cirrus gets to take part in all of Apple's successes -- but also shares Cupertino's hard times. You see, Apple alone accounted for 82% of Cirrus Logic's total sales in 2012, and Apple's portion of Cirrus revenue is on the rise.

So it stands to reason that Cirrus shares tend to follow Apple's ups and downs on the stock charts, with a few crucial exceptions.

CRUS Chart

CRUS data by YCharts

In May, Cirrus shares dove 20% lower overnight as CEO Jason Rhode took the stage at an industry conference to talk about pressures in the smartphone industry. Any pressure on Cirrus Logic's smartphone market must be a threat to the company's place in Apple products. If nothing else, rising competition will compress Cirrus' gross margins over the next couple of years as the company uses price as a weapon.

The stock recovered alongside Apple over the summer, as the upcoming release of new iPhones and iPads promised to boost sales once again. But the second-quarter report crushed analyst targets only to remind investors of those troublesome gross margin trends that Rhode mentioned in May. Cirrus stock took another deep plunge the next day.

And then the other shoe dropped. Not only is Cirrus facing lower gross margins as it fights for its place in Apple's supply chain, but Cupertino also proved that not even Cirrus has a guaranteed seat at the table. The stock took another 13% haircut as the iPad Air turned out to supplement its Cirrus-branded core audio chip with amplifiers from competitor Maxim Integrated Products (NASDAQ:MXIM).

It's not a huge loss for Cirrus and not a big win for Maxim, because the amplifiers are a very small part of the iPad Air's total materials bill. Maxim shares hardly moved on the news.

But it was a shot across Cirrus' bow, as Apple showed Cirrus that anything can happen. If the next component contract Cirrus loses to a rival turns out to be the main audio codec in 2014's iPhone update, Cirrus could be in real trouble.

And that's why Cirrus Logic shares took a 29% tumble in 2013 while the market surged 29% higher: Apple is no longer the guaranteed winner it once was, and Cirrus' role in Apple products suddenly looks riskier as well.