More generally, a yield curve inversion is when the interest rate you earn on short-term debt ends up higher than that of long-term debt of the same quality.
I don't think the issue is that the inversion causes the recession. It's more an indicator of pessimism in the market. It implies that investors think that interest rates are going to get worse, so they look to buy more longer-term bonds in order to try and lock in current yields for a longer period of time. That increases demand for those assets, which drives down their price^H^H^H^H^H yields.