Same thing that happens if you put up any kind of collateral that later becomes worthless: the lender doesn't get their money. That's the risk of collateral.
This is why mortgage lenders require you to maintain insurance on your property: if the house burns down or something, the lender still wants that money. If a house gets destroyed in a way that's not covered by insurance (say, by an earthquake in California, where most people don't have earthquake insurance), then the lender loses their money. (The former homeowner probably stops payments and gets their credit ruined.)