You seem to assume a free market for housing, that would be at least partially incorrect. The free market is a cause of long term (timeframe of decades) housing unaffordabilty because the haves treat housing as investment while the have-nots live under bridges or in cars which puts them in an unemployment/debt spiral.
The free market could work if housing was a depreciating asset like cars. Too many people in the west would be pissed off if that happened, though. It will come to some countries with collapsing demographics and that won’t be a pretty sight.
Given the numerous government regulations, as well as regulatory capture and NIMBYism, housing is not a particularly free market. Zoning and building codes (only some of which are important for not making death traps) as well as low income units lead to prohibited or high costs of construction.
>It will come to some countries with collapsing demographics and that won’t be a pretty sight.
Except that's not how it happens. Demographics have been collapsing in many EU countries for a while now and prices have been going nowhere but up at rates beyond wage growth.
Internal migration from rural to urban, and external migration from war torn and impoverished nations also to urban centers, keep pushing demand up regardless of local reproduction numbers.
Sure, you can now buy cheap properties in some empty towns in the south of Italy for example, but to what end if there's no jobs there?
>At some point we run out of people in rural areas to migrate to urban
But you won't run out of external migrants due to wars, climate change and poverty who want to leave their countries and move to the western developed ones.
The free market could work if housing was a depreciating asset like cars. Too many people in the west would be pissed off if that happened, though. It will come to some countries with collapsing demographics and that won’t be a pretty sight.