Any friendship or relationship that we have works to reflect our needs at that point of time. Then we stick with it for the rest of our miserable lives.
Either we see ourselves in a person, or would like to be identified as or with that person, and that causes the formation of any relationship.
Furthermore, any new relationship/friendship serves to identify our internal conflicts and demons. It is in effect - a projection of our subconscious mind. The fulfillment of a void via an external person is the basis of any friendship/relationship.