If there is a softening in real estate prices, coupled with a slump in securities, those with cash may want to put their money in real estate in the hopes of seeing a good returns when the recession turns around.
Even with rising interest rates, if someone locks in a loan where they can break even with renters, they can sit on the property waiting for the market to recover.
This looks particularly attractive in the scenario where high interest rates combined with a recession creates difficulties for many people to purchase a home, in which case they will rent and be paying off someone else's loan/giving them a return on their invested cash.
Unlike companies, property doesn't go bankrupt. It can devalue, but there is often inherent value in the fact that it can be rented out, so there is decent stability. I guess, though, if there is a major regional shift where the property is located, like a manufacturing plant in the midwest shutting down, there could be a drop in housing prices and rental demand that would be very difficult to recover.