From what I've seen, the assumptions tend to dominate this discussion. I'm absolutely cherry-picking to make a point, but if you took your down payment in 1965, thinking the market looks pretty darn good, and put it into a DJIA index fund while you rented, about 30 years later, your investment would finally be worth again what you put in [1], while the person who bought the house would have some sort of equity in it.
To cherry-pick in the other direction, if you could either buy or rent starting in 1980 or so, in 30 years you'd see ~7x return (no inflation adjustment). There are homes you could buy in 1980 that would exceed that, but not very many places, and it's tricky to know what those are without hindsight. (Investing is pretty easy in hindsight, in general.)
To the extent that the stock market is modeled by an exponential curve, it has deviations from that curve on the order of your entire working lifespan.
Discussions about the utility of the stock market for retirement revolve around you investing in it continuously. In that chart, even though a point investment in 1960 may not turn out well, the money someone is putting in every year will start to do pretty well in the 1980s. The analysis around buying in a bit every year is different, but in the previous paragraphs, I'm talking about a point-in-time investment of a particular sum, so we can just follow the chart across. If you can finagle a rent that is significant lower than a mortgage, then you can also include in your model putting that difference into the market. (Though, for that to be "valid", note you actually have to, you know, do that.) But while rents and mortgages tend to be close to each other for various reasons, at different times and places they trade off which is more expensive, so that's not an assumption you're justified with in the general case.
So if you've got a mortgage cheaper than rent in 1960, you're going to pretty handily beat the guy investing in 1960 for quite a span of time. If you can get rent cheaper than a mortgage in 1980, and invest the difference over time as well, you're going to handily beat the guy buying the house.
What about if you buy a house, say, right now? Well... that's the million dollar question, isn't it?
To cherry-pick in the other direction, if you could either buy or rent starting in 1980 or so, in 30 years you'd see ~7x return (no inflation adjustment). There are homes you could buy in 1980 that would exceed that, but not very many places, and it's tricky to know what those are without hindsight. (Investing is pretty easy in hindsight, in general.)
To the extent that the stock market is modeled by an exponential curve, it has deviations from that curve on the order of your entire working lifespan.
Discussions about the utility of the stock market for retirement revolve around you investing in it continuously. In that chart, even though a point investment in 1960 may not turn out well, the money someone is putting in every year will start to do pretty well in the 1980s. The analysis around buying in a bit every year is different, but in the previous paragraphs, I'm talking about a point-in-time investment of a particular sum, so we can just follow the chart across. If you can finagle a rent that is significant lower than a mortgage, then you can also include in your model putting that difference into the market. (Though, for that to be "valid", note you actually have to, you know, do that.) But while rents and mortgages tend to be close to each other for various reasons, at different times and places they trade off which is more expensive, so that's not an assumption you're justified with in the general case.
So if you've got a mortgage cheaper than rent in 1960, you're going to pretty handily beat the guy investing in 1960 for quite a span of time. If you can get rent cheaper than a mortgage in 1980, and invest the difference over time as well, you're going to handily beat the guy buying the house.
What about if you buy a house, say, right now? Well... that's the million dollar question, isn't it?
[1]: https://www.macrotrends.net/1319/dow-jones-100-year-historic...