It’s not because they make us sad but because they help us feel connected, a new study suggests.