That house has value because it is connected to a road, power plant, sewer system, running water, etc. in a municipality that provides schools, EMS, firefighting, police, etc. Its future value is protected by zoning which ensures loud/ugly/polluting/busy buildings will not be located nearby. It is reasonable for the mortgage lender to make the loan because such contracts are enforceable in court, and it can count on the state to seize the house from a delinquent borrower even if the bank itself owns fewer guns than the occupant. The house is guaranteed to meet certain minimum workmanship quality and safety standards set by the state, verified by inspection, to minimize buyers' exposure to lemons.
Very little about the real estate market is emergent. This is an excellent example of a market created by society.