There are two reasons why an inverted yield curve could happen
1. When investors think the economy will enter a recession in the near future, they will settle for lower yields associated with low-risk long-term debt, which would likely result in higher returns than investments in equities during the same time.
2. When the market believes inflation will remain low, there will be more demand for bonds on the long end of the yield curve, causing long-term rates to fall.