Being a landlord is profitable.
The rent you pay on a house covers all the costs of ownership (cost to buy the home, mortgage principal & interest, repairs, taxes, insurance) AND there is some left over as profit for the landlord.
If you owned the house instead of the landlord, you are still paying the same costs, but you don't have to pay the extra profit to the landlord. That is the amount of money you save by owning over renting.
There are edge cases, like people who want to move every year, but this is a useful heuristic. You can pay your landlord's salary or you can be your own landlord and keep that money for yourself.