THE world of bonds is usually thought of as one of rigid divisions. At one end of the scale, there is government debt: safe, reliable, suitable for widows and orphans. At the other end, there are junk bonds: speculative offerings issued by companies with poor credit ratings and suitable only for the young and reckless.

That picture looks a bit out of date. Speculation is rampant that Greece might be about to default on its government debt again. Meanwhile, the short-term bonds of many European countries are trading at negative yields. That means investors are guaranteed to lose money in nominal terms (ie, before accounting for inflation).

Junk debt also looks a lot less like garbage than it used to. Contrary to its reputation, issuers are proving to be reliable payers, as a new study by Deutsche Bank shows. Since 1983 (the period for which Deutsche has data), the default rate for junk bonds has averaged 4.9%. But that disguises a big change that occurred after 2002. The average default rate from 1983 to 2002 was 6.9%; since then, the average has been just 1.5%. In this later period, the only year in which the default rate was above the long-term average, at 15%, was 2009, when the world economy was slumping.

This is particularly surprising given that the creditworthiness of issuers has steadily declined over time, as judged by the rating agencies. A bigger proportion of them is in the “C” categories, the lowest tier for those that have not actually defaulted. This should, over time, have led to a greater number of deadbeats.

So what has driven the improvement? More than anything else, corporate debtors depend on confidence. They borrow not just from the bond markets, but also from the banks. When they get into trouble, it is usually because the banks will not extend their loans. And when that happens, they often struggle to keep up with their bond payments.

The result is that the corporate-bond markets can get into virtuous or vicious cycles. In the former, confidence is high and the spread (excess interest) paid by riskier borrowers is small. As a result, such borrowers find it easier to service their debts, bringing spreads further down, and so on. This has been the dynamic for much of the past 13 years.

The cycle has been reinforced by monetary policy. Short-term interest rates have been zero, or even negative in some countries, and central banks have also steered long-term government-bond yields to historic lows. That has prompted income-seeking investors to turn to junk bonds to add a bit of juice to their portfolios.

Ultra-low rates have allowed corporate borrowers to lock in cheap credit for the long term.

Moody’s, a rating agency, says that issuance of high-yield debt in America in the first quarter was $79 billion; in Europe it was $39 billion. Both figures are higher than in the same period of 2014. There was also a rise in the number of issuers borrowing for eight to ten years rather than the usual six or seven. The longer the maturity, the less vulnerable the borrower to a sudden decline in confidence.

So what might trigger a shift into a vicious cycle, in which a loss of confidence leads to higher spreads, making it more difficult for companies to finance themselves? Deutsche reckons that the willingness of banks to lend depends on the shape of the yield curve—the difference between the rates available on short- and long-term debt.

When rates on long-term debt are much higher, banks earn a good return lending to companies. But as the gap narrows, or even turns negative, they lose their enthusiasm for lending. As they turn off the taps, many of the companies denied bank loans also end up defaulting on their bonds.

Deutsche’s research shows that there is a lag of around 30 months between the yield curve becoming flat and a rise in defaults (see chart). Another important factor is the level of real rates (ie, after accounting for inflation). High real rates also lead to higher defaults with a 30-month lag. Based on these two factors, Deutsche predicts the next upcycle in American defaults will occur in the second half of 2017. In Europe, where there tends to be a shorter lead time, a rise may occur in the second half of next year.

Of course, investors in junk bonds can suffer losses without a sharp rise in defaults. If the general level of bond yields rises—perhaps because of an increase in inflation or a sudden change in monetary policy—the price of junk bonds will fall. But not many people are expecting that to happen. The enthusiasm for junk is not going away.