It is also tied to our developmental needs to grow and become strong so that we can survive and procreate. Much of our Primal pain is relational in nature. It is about being tolerated, accepted, and nurtured by other human beings. Much of this is tied to the fact we are social animals. So loneliness is most likely an emotion associated with social animals.
Feelings are symbolic of the meaning of human life.
I believe what many religious and spiritual traditions have conceived of as cosmic, is really just human. God the father is the great parent in the sky. That, I believe, is a projection of what is human, onto the cosmic, impersonal, domain. Buddhism as I understand it is about object relations. The Buddha asserted that the cause of suffering is desire and attachment.