Apple's (NASDAQ:AAPL) most recent quarter was quite good, with the company delivering revenue and earnings per share ahead of expectations, thanks in no small part to better-than-expected iPhone revenue.

Nevertheless, despite the better-than-anticipated financial performance, the company's operating income dropped from $24.17 billion to $23.35 billion. Net income declined from $18.36 billion in the year prior to $17.89 billion.

Apple's iPhone coupled with AirPods.

Apple's iPhone coupled with AirPods. Image source: Apple.

Apple is still raking in a lot of cash -- most companies could only dream of generating roughly $18 billion in annual net income, let alone bringing in that much in a single quarter -- but investors should pay attention when profit declines. Let's go over the key factors that drove Apple's operating and net income figures down year over year, even as the company achieved record quarterly revenue.

Lower gross profit margin

Apple saw its gross profit drop from $30.42 billion in the prior-year period to $30.18 billion in the company's most recent period. Although the company's revenue was up year over year, cost of sales grew at a faster pace than revenue did, resulting in a decline in gross profit margin.

Apple did note on its most recent earnings call that in the prior-year period, Apple's revenue "included the benefit of a one-off $548 million patent infringement payment." Though not a substantial part of Apple's $75 billion-plus in revenue in that quarter, CFO Luca Maestri did say that this payment boosted gross margin in the year-ago quarter by 40 basis points, or 0.4%.

The gross-margin story isn't the only thing that drove Apple's profits slightly lower year over year, though.

Higher operating expenses

Gross profit margin is an important part of overall profitability, but a company's operating expenses -- which include product development costs as well as sales and marketing costs -- are also key determinants of a company's profitability.

Though Apple only increased its sales, general, and administrative expenses by just shy of $100 million year over year, its research and development spending surged to $2.87 billion -- up more than $400 million from the roughly $2.4 billion the company spent in the prior-year period.

Apple's operating expenses grew 9% from $6.25 billion in the prior-year period to $6.82 billion in the most recent quarter. Since operating-expense growth was greater than revenue growth, which was approximately 3.3%, operating expenses became a larger part of the company's revenue and thus negatively affected operating profit margin.

What does this mean for Apple investors?

The key headwinds to Apple's operating profit right now seem to be the company's continued increases in research and development, coupled with slow revenue growth.

It's probably not a good idea for the company to let up on its research and development investments, as the investments made today are what allow the company to have a chance of bringing compelling new products to market tomorrow, potentially driving revenue and profit increases over the long term.

In the near to medium term, Apple's best bet of returning to consistent operating profit growth is likely to be from faster revenue growth. Hopes seem to be high that Apple's next-generation iPhone models will drive a so-called "super cycle" such as what the company enjoyed with the iPhone 6-series of products beginning in late 2014.

If that comes to pass, Apple could see significant year-over-year revenue growth in the first quarter of its coming fiscal year.

Looking out longer term, though, it's hard to predict if and how the company will deliver sustainable profit growth. Can the company's core product categories do it? Or will the company need to enter or create new product categories beyond the iPhone, iPad, Mac, and services to support such growth?

These are questions that will only be answered in time. 

Ashraf Eassa has no position in any stocks mentioned. The Motley Fool owns shares of and recommends Apple. The Motley Fool has the following options: long January 2018 $90 calls on Apple and short January 2018 $95 calls on Apple. The Motley Fool has a disclosure policy.