NPCs prefer living in specific biomes and near certain other NPCs which affects their happiness level.
Happier NPCs offer lower prices and can unlock biome-specific pylons for fast travel.
Overcrowding a home reduces happiness so limit two or three NPCs per housing area.
Using the housing query tool helps determine each NPC’s likes and dislikes easily.