We are social creatures. You can be born into an identity, a class, a profession, and that’s fortunate. A person creates their identity by contributing to the group.
How big is a group? It could be two people. A couple can represent a large number of people. They have attachments to other people. A man dates a woman. He could impress her, but the relationship will be tested if he fails to impress her friends. The approval of her friends affects her emotions and her social status.
Loneliness is painful. For a biological creature being alone is not a favorable condition for survival. We don’t survive as individuals. Unless you’re raised in the wilderness, you need other people to survive. The family, the tribe. Strong attachments are a survival instinct.