My fellow Foolish colleague Evan Niu recently penned an excellent column discussing Apple's (AAPL 0.42%) skyrocketing investments in research and development. In a nutshell, even as Apple's revenue growth has slowed (and, in the case of fiscal year 2016, turned negative), the company has continued to ratchet up its spending on research and development.

Image source: Getty.

The slowing revenue picture, coupled with continued growth in research-and-development spending, has eaten into Apple's overall profitability, which may draw concern from some investors.

AAPL Operating Margin (TTM) Chart

AAPL Operating Margin (TTM) data by YCharts

Now, even though a good chunk of that now quite large research-and-development budget is probably being spent in service of all new product categories that haven't yet begun to generate revenue (Evan mentions augmented and virtual reality, and self-driving cars as two examples), I believe that a large part of the growth is also spent servicing of the company's existing product lines.

The natural R&D inflation

Investors should always expect the costs to develop future versions of existing product lines (e.g., the iPhone, iPad, Mac, and Watch) to gradually rise. That natural inflation in research-and-development spending is driven by several factors.

One obvious one is the fact that many companies, especially healthy ones, tend to give their employees raises. Even if one figures that these raises are on the order of 2% to 3% per year, that's still going to have a real impact on a company's operating expenses.

Beyond that, there's the simple fact that these devices become much more complex in terms of both hardware and software each and every year. The sheer amount of engineering effort that goes into building something like the iPhone 8 is going to be way more than what it took to build the much less sophisticated iPhone 5.

Advancing the state of the art doesn't come cheap.

Apple is bringing more technology development in-house

Back in April 2015, in response to a question from an analyst about Apple's increasing research-and-development spending, Apple CFO Luca Maestri said the company is "developing some core foundational technologies more in-house now than we have in the past."

By bringing key technologies in-house, the company can tailor technologies to better suit its product needs. This, ideally, should allow Apple to deliver superior user experiences.

More importantly, though, by bringing more technology development capabilities in-house, it can work on proprietary features and innovations that it can keep exclusive to its own products for longer -- potentially opening competitive advantages for Apple's products in the marketplace.

Don't worry about Apple's R&D spending if it produces results

In an ideal world, Apple (or any company, really) would be able to spend an anemic amount of money on research and development while bringing in large amounts of revenue at high gross profit margins. Unfortunately, that's just not how it works.

The key is for Apple to spend what it must to make sure its products in its core markets are best-in-class while making smart bets on new technologies, products, and services that could potentially open large revenue streams in the future.

So far, I'd say Apple has done a good job of managing that, so investors should have a little faith that if Apple is boosting its spending that it's doing so to maximize long-term shareholder value.