First off, you have land or a fraction of the land in your real estate unless it is a mobile home or trailer home having to pay lot rent. You notice there is a huge difference in home with lot or without lot that a real home will over time adjust to inflation or appreciate, while mobile home price would depreciate as it age. This tells you it really is the location rather than the physical building that is worth the value.
Second, home price is highly depended on the location rather than just the building labor and material cost. The example I frequently use is a house about to fall off a cliff is worthless while a burnt out house in a highly desirable neighborhood is worth quite a bit, and people will pay a lot to restore it. This is not because of the building cost but rather the location. Location dictates the upper and lower bound of how much the building is worth, not the other way around. p.s. you can get a home for free in many part of the world or even in the US like Detroit, but many people won't want it.
The higher the price of an item the more it is valued as a tool vs a toy. Fashion, let's use clothes as an example, have value dropped much faster when it goes from new to no longer new, even in the same condition. As people move from fashion to tool valuation changes to "how much can I use it and is it worth paying this much" instead of "I really want it because it makes me happy". This is why people would buy a new model year car at a much higher value than when it is older and everyone and their mom already has it. Remember the new beetles or PT Cruiser? They were in super high demand and then eventually nobody wants it. You don't see the same depreciation on new vs used semi truck compare to new vs used Lambo or Mercedes.
One last thing about demand and supply: you have limited space to build homes, you can go further but you cannot compare it due to commute distance or location / school. You CAN move a car around and sell elsewhere. So what happen is when a car is new you have way higher demand and low supply but when you keep selling the same thing without refresh people will have more used car to choose from, driving down the new car prices. This happens in all mass produced product like electronics, furniture, cars, etc. The most profitable time is the first 6 months of the release, but you cannot do the same with house because commute is not the same and neighborhood is not the same, and land is finite.