One of the fundamental concepts of finance is that risk and reward should be correlated. That is, the higher the risk of an investment, the higher the potential reward should be. At its extremes, you can see this dynamic by comparing U.S. Treasury bonds and short-dated commodity futures. The former has a low long-term return, typically below 4% and often much lower, thanks in particular to the low risk of you getting your investment and interest payments. Short-dated futures, on the other hand, have the potential to increase exponentially in value or go to zero.

An investment that had half of one of these features and half of the other–like a low risk investment that would have the potential to grow multiple times in value–would be a rare example of a market mispricing of risk. These are the kinds of discoveries that active investors look for; when they find high risk priced into a low return, they will short it; inversely, low risk priced into a high return attracts investment.

This dynamic drives credit markets in a natural and mathematically proportional fashion. It would not be too absurd to describe the relationship as beautiful. In credit such as corporate bonds, high interest translates into higher risk and vice versa. In most situations, then, U.S. Treasuries will yield less than municipal bonds, because the U.S. government is less likely to default than municipalities. Those munis, on the other hand, will yield less than corporate bonds. Then–and here’s where the beauty comes in–as the secondary market for these assets reassesses the potential risk in these assets, they will price them accordingly in an auction. Thus, when demand for a bond is high, its price rises and its yield falls. This dynamic also holds for dividend yielding stocks, although the dynamic is not as mathematical and consistent as it is with bonds.

If this dynamic, which is at the heart of finance and a basic truism, is to be expected throughout all markets all the time, why do we sometimes see, for instance, a corporate bond yield less than a government bond yield for the country that houses that corporation? In the past, Apple (AAPL) has issued bonds that have yielded less than U.S. Treasury bonds. How is this pricing possible? Surely the U.S. government, which can issue its own currency and thus pay back its debts whenever it wants, is by definition always less risky than AAPL’s bonds.

The simple answer to this is that bonds price in much more than default risk, and other aspects of a bond’s price were driving that discrepancy. In the case of Treasuries, the higher yields relative to Apple bonds in the mid-2010s was due to market expectations of the Fed’s higher interest rate policy to come, which would make older bonds less valuable. Thus it is clear that one cannot factor in just one risk when pricing bonds.

That makes pricing credit hard, but not impossible–and many would argue that credit markets follow much clearer rules when it comes to price discovery than equity markets. That would also imply credit markets are more rational and less volatile, the latter of which is demonstrably true. But that also means credit markets will have lower returns (again true) and less risk (for the most part, true too).

Every once in a while, then, a credit analyst will find a genuine error in the market–a bond that has been mispriced relative to its various risks. Since credit markets are less liquid and less closely analyzed than equity markets, these errors are surprisingly common–and they are great opportunities to make a profit. That is, if you have enough data to do the proper pricing and the market access to take advantage of it. That’s how, and why, big investment firms can and do crush their indexes in credit markets, even if beating the S&P 500 is so much harder.