Usually beds and defense
At Sanctuary, I have 16 settlers (plus two companions) and 24 beds, with a 60+ defense score. However, when I am not at Sanctuary, my pipboy tells me I have way less beds and defense than that, and that the town's happiness is decreasing! When I travel to Sanctuary I see that the resources are normal, but settlers will still complain about there being not enough beds, even though there's more than enough beds for everyone...what gives?
The town's happiness gradually decreases while I'm away because I guess the game thinks there really is a deficit of beds and defense. Only when I'm in the area does the happiness start going back up.