What I am about to write has probably been much better stated by some writer centuries ago with whom I am not familiar. I hope that is true and that someone sends me what another has written so I can learn from that writer. But here goes my take on the capacity for friendship.
Everyone has problems and issues. But the one out of "the everyone" who has the capacity for friendship is able to bracket those personal challenges and go out of herself and reach out to the other. The one with a capacity for friendship is able to see the struggles and desires of the other and chivalrously, generously, and magnanimously assist the other to overcome, to achieve, and to fulfill those healthy desires. If you meet someone like that, you will make that person your friend in no time; and you won't let go unless you have really taken leave of your senses.
And the unoriginal insight is that to gain a friend is to be that type of friend--the magnanimous facilitator of all that is good for the other. Once a friend is revealed as someone who stands in the way of your happiness or sabotages your happiness or is unsympathetic to your struggle for happiness, the capacity and very reason for the existence of friendship are lost. Many who lose friends just do not understand this reality at all and remain puzzled. This type of friendship--what I consider authentic friendship--requires a selfless intuition: to see what the other needs which may be very different from what you think the other needs or should need. Without that intuition, what passes for friendship is mere co-existence in the same space-time coordinates.
CC license via Wikimedia Commons