Apple's (NASDAQ:AAPL) investors have enjoyed rapid EPS growth during the past few years, driven primarily by fast-growing iPhone sales and the tech giant's aggressive and effective share repurchase program. But one key catalyst for Apple's recent EPS growth that probably hasn't been as obvious to most investors is its improving gross profit margin. This driver for EPS growth, however, faces uncertainty.

Iphone
iPhone 6s. Image source: Apple.

Apple's gross profit margin story
In 2013, Apple's gross profit margin comparisons were downright scary. In fact, Apple's second-quarter gross profit margin in 2013 was around 1,000 basis points lower than in the year-ago quarter.

Apple Gross Margin Q
Data for chart retrieved from quarterly filings. Asterisk indicates management guidance (midpoint from guidance range is used). Chart source: Author.

The reasons for Apple's poor margin comparisons in 2013? A relatively brutal cost curve for a recently introduced iPad Mini compared with previous iPads, and higher initial costs for producing the iPhone 5, which had a drastic overhaul on its form factor.

And the narrative surrounding the stock wasn't pretty. As Android devices rapidly gained market share, and smaller and cheaper tablets started to eat away at Apple's dominance in the nascent category, investors wondered when the iGadget maker's narrowing margins would moderate.

These poor gross profit margin comparisons, of course, coincided with the stock's huge sell-off from a split-adjusted $100 in 2012 to a low near $57.

As it turned out, Apple's gross profit margin bottomed in 2013 -- and it's been on the rise on a year-over-year basis ever since. Key to the company's rising profit margins during the past two years have been growing iPhone sales (Apple's iPhone represents the company's most profitable product segment) and higher-priced options for iPhone.

The narrative surrounding Apple's gross profit margin trend is optimistic these days. The improving metric confirms the company's pricing power with consumers. And comparisons are excellent again. Consider Apple's gross profit margin in its most recent quarter: At an impressive 39.9%, it's about 290 basis points higher than it was two years ago and 240 basis points higher than it was a year ago.

Gross margin headwinds ahead?
While Apple's improving gross profit margin has been an undeniable boon for the company's financials, investors know the key metric can't continue upward forever.

Apple Stock
Image source: Apple.

There are two specific reasons it may not be as easy for Apple to continue posting year-over-year gross profit margin improvements in 2016 and 2017.

First, with iPhone prices now reaching as high as $949, it's unlikely there's much more room left for Apple to boost average selling prices for its smartphone segment.

Second, Apple's guidance for its first fiscal quarter of 2016 suggests the company probably isn't expecting iPhone sales to grow as rapidly over the next 12 months. Indeed, it wouldn't be surprising if single-digit percentage growth for Apple's iPhone segment becomes the norm in the near future. And if iPhone sales growth slows to a pace in line with the rest of Apple's overall business, the company couldn't benefit from a growing portion of sales from its most profitable segment.

So Apple's gross profit margin could peak soon.

Daniel Sparks owns shares of Apple. The Motley Fool owns shares of and recommends Apple. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.