There are plenty of places where many people can afford market-rate rentals, while there is nothing they can afford to buy. That includes some major cities, where land is inherently scarce, as well as other desirable locations, where the locals have chosen to ban sufficient housing.
Rents are ultimately based on what people can afford to pay. Home prices, on the other hand, also reflect the viability of the home as an investment. If the market believes that housing will not become more affordable in the foreseeable future, homes in that area are low-risk investments, and investors will accept lower returns for their money. Home prices grow very high relative to rents. Taking a mortgage to buy then becomes the financial equivalent of taking a loan and putting the money in a savings account.
The city where I live in California is one of those places. Before Covid, home prices were high but tolerable. Then the prices jumped due to WFH, while rents grew at a much slower pace. And then interest rates went up without making a dent in home prices, making homes too expensive for those poor enough to need a substantial mortgage.