And a very basic part of it is simply geometry: the more people you have in a limited area, the harder it is to build homes for all of them. Historically, there simply were FAR fewer people, and so finding place for homes was never a huge issue. The cost of housing is mostly property, not construction costs.