I'll give a specific example, as I'm sure this varied from time-to-time and place-to-place. Say I'm a villager at a neighboring hamlet, and a town nearby is sacked during the Hundred Years' War. The population is decimated, but many houses are still there in working condition with no one living there. If nobody comes and claims the house, may I move in? No one else is staking a claim to this house via inheritance - they all perished tragically in the sacking.
EDIT: This question was inspired by today's Wikipedia article of the day, on the Battle of Caen (1346).
This thread from last year answers this pretty complete in regards to empty houses from the plague.
Essentially a lot of houses were owned by the lord and they could give someone a house to work land for them.
Edit adding credit user: u/william_oakham