Editor's note: This story has been updated after the Fed rate hike; it was first published in September.

"Don't fight the Fed" has proven to be pretty sage advice over the years.

Now that the Federal Reservehas hiked interest rates for the first time in nearly a decade, investors might need a refresher course on how higher rates may affect their portfolios.

Raising rates is one of the best tools that the Fed has at its disposal to keep the economy on track. The Fed's mandate from Congress is to smooth out the economic cycles and promote "maximum employment, stable prices, and moderate long-term interest rates."

In reality, the Fed doesn't actually set "interest rates" per se. Instead, it sets a federal funds target rate, which the Fed tries to achieve through open market operations -- buying and selling bonds on the open market to change the money supply.

Image placeholder title

Other Rising Rates Stories:

So when the Fed raises rates, it's really making "money" more expensive. Higher rates mean higher borrowing costs for companies that need capital to build factories or for consumers looking to buy a new car. On the flip side, higher rates also mean bigger returns for the investors lending their money.

If it sounds like higher interest rates are a problem for the economy, that's because they are.

When capital is more expensive, it basically pumps the brakes on economic activity. But that's usually exactly what the Fed is trying to do when it hikes interest rates. Rising rates help to curb inflation, keeping it from getting out of hand and hurting the economy even worse.

Are Higher Rates Good or Bad for Stocks?

It's not hard to see why investors have been squeamish about rate hikes from the Federal Reserve.

Higher interest rates mean higher costs of capital for the companies in your portfolio, and they mean added pressure on firms that sell capital-intense goods such as cars. That's why it might be so surprising that, looking back historically, rising rates have actually tended to coincide with higher stock prices.

The chart below takes a look at the S&P 500's performance vs. the high end of the Fed's federal funds target rate since 1970.

Image placeholder title

The timeframes highlighted in green are the periods when the Federal Reserve was increasing its target rate. Generally speaking, those periods have come with upward movement in the S&P 500. In fact, studies done in the past indicate that the S&P generally earns between 8% and 10% annually when interest rates are moving higher.

That seems like great news for rate-hike worriers.

But what those studies don't take into account is causation. Historically, rates get hiked when the economy is growing too quickly and stock markets are getting too exuberant -- so it's not surprising that markets keep moving up as the Fed starts to pump the brakes. Put simply, the Federal Reserve doesn't increase interest rates when stocks are plummeting, and that jukes the stats a bit.

That doesn't mean that we don't have some idea of how the rate hike will impact stock prices, though.

Who Does Well When Rates Go Up?

It may seem ironic, but high-yield income investments (such as dividend stocks and bonds) are actually the ones that suffer the most when interest rates move up.

That's because income investments get their value from how much they're paying investors beyond the risk-free rate. If the fed funds rate rises, so too does the rate that investors can collect on risk-free (or nearly risk-free) assets -- and that high-yield stock suddenly looks a whole lots less appealing as a result.

Hard assets, such as gold, also tend to perform poorly when rates are on the rise. Gold and other commodities tend to be a good protection against inflation, so when higher rates cut inflation levels, they also cut hard asset prices.

Real estate is one hard asset that doesn't play by that rule. Real estate actually tends to do well historically when inflation rates are on the rise.

Since higher rates increase borrowing costs for companies, stocks with low levels of debt and high levels of cash tend to do better in rising rate environments. (They're also able to earn bigger returns on those cash holdings.)

Financial firms that hold large cash positions for their clients (such as payroll services firms and investment brokerages) also benefit from higher float interest revenue when rates rise.

This Time It's Different?

The old saying goes that the four most expensive words for investors are "This time it's different."

And while that's good advice for investors watching the Fed right now, the fact is that this time it really is different.

For starters, rates have been at historic lows for seven years. At the moment, the Federal Reserve is targeting a fed funds rate of 0.25%, which just bumped up for the first time since the financial crisis of 2008. But the Fed is under pressure to bring interest rates into more "normal" territory, especially as we approach year seven of the economic recovery.

The problem is that the recovery is a little shakier than in past periods.

We'd never before seen the Fed raise interest rates at a time when inflation was as low as it is today. (In fact, Ben Bernanke's biggest battle was against deflation, one of the major forces that caused the Great Depression to be so severe.) In the past 45 years, the Fed never before initiated a fed funds rate hike when the U.S. Bureau of Labor Statistics' CPI readings have been below 1%.

That inflation gauge is currently at 0.2% -- and plummeting prices for commodities such as oil and gas are threatening to drag it into negative territory.

In other words, the Federal Reserve is pushing into uncharted territory.

And that makes it a lot more difficult to figure out whether the rate hike talk is a real plan, or whether the central bank is testing the waters to see how investors react to the idea that the economy may be stable enough to boost rates. This wouldn't be the first time the Fed has used its PR mechanism to test investors' feelings or has backed off a policy change gone bad.

At the end of the day, rate hikes from the Federal Reserve are and will remain extremely measured. Janet Yellen and company aren't going to risk shocking the system with a big boost to their target rate. The good news is that a rate hike doesn't have to be a crisis for stock market investors.

Disclosure: This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.