Earlier quoted context omitted.
A mortgage doesn’t make money, but it (can) enable spending less money. If you buy a place such that interest, maintenance, insurance, taxes and the opportunity cost of not being able to easily relocate are less than rent, then you have saved the difference. It’s also a way to force saving, which is psychologically useful (and thus valuable).
If you buy a house for 500k on a 5% mortgage over 25 years when you are 25, and you plan to live until you are 85, you will live there for 60 years. It will cost you 35k a year for 25 years, or 875k a year After 25 years you have no more expenses. If instead you rent it for 20k a year, increasing with 2% inflation each year, by year 25 you're paying 33k a year in rent, and by year 60 you're paying 66k a year. Over 60…
btw this is usually false, and mostly irrational.
1. Realize that every landlord has a different capitalization structure. Many likely bought decades ago and thus only owe a fraction of what the current market selling price is. Additionally we also have had a long period of ultra low interest rates so their interest rate is different than what new entrants are paying. Because their capital cost is lower they can actually offer for far less than the (Interest+Taxes+Insurance+Maintenance) costs that a home owner would have to bear.
2. The rational move of a landlord is to price competitively based on what the market can bear, even possibly losing a little money per month in cashflow (but less bad than the appreciation rate and cost of disposal/selling/defaulting).