The concept of real estate as an inflation hedge is because real estate is a hard asset. Inflation is a concept that is tied to paper money, because governments can just print more money whenever they decide to, for whatever reason. But when the government does this, it devalues the currency that has already been issued, so people holding paper assets now need to pay more of them to buy the same thing.
Ergo, when you are afraid of inflation devaluing the pieces of paper that you keep in your wallet and that your stocks/bank accounts are denominated in, you want to trade that money for something that the government can't just print more of. Real estate has always been a significant go-to, because excepting certain locations, the old adage "they aren't making any more of it" holds true. Gold/precious metals have also been used for this purpose, simply because they are comparatively scarce and hard to find.
Note that these investments have their own risks. E.g., except for some modern industrial applications, gold has zero inherent value and is worth so much only because we humans think it's pretty; similarly, if someone discovered a huge source of gold that quintupled the world supply, then you'd have the gold version of inflation, and the value of the gold already out there in circulation would crash. They also remain subject to the laws of supply and demand; if you choose a home next to a toxic waste dump, the fact that they aren't making any more land still won't make people want to live on the land you own.
So it's not that these investments are "better" or "worse," or "safer" or "riskier," or that you will make more money over time one way or the other. It's more that they are subject to *different* risks than paper assets, and therefore RE/precious metals/etc. can be used to hedge against the risks posed by paper assets, and vice-versa.
Tl;dr: there's no guarantee that, on average, property values will increase above the rate of inflation, especially once you include all expenses; OTOH, holding RE can provide awesome protection if you are worried about a massive inflationary spiral as some other countries have experienced.