I'm wondering why some people have many friends (lasting friendship like friends since kindergarten to college)while some has almost none. I understand that it would depend on situations in present. But if there's effect from past, what would these be? From buddhism point of view.
Well you'll never know. From a Buddhism point of view, it could very well be a blessing in disguise:
On one occasion a certain monk, a Vajjian princeling, was dwelling near Vesali in a forest thicket. And on that occasion an all-night festival was being held in Vesali. The monk — lamenting as he heard the resounding din of wind music, string music, & gongs coming from Vesali, on that occasion recited this verse:
I live in the wilderness
like a log cast away in the forest.
On a night like this,
who could there be
Then the devata inhabiting the forest thicket, feeling sympathy for the monk, desiring his benefit, desiring to bring him to his senses, approached him and addressed him with this verse:
As you live in the wilderness all alone
like a log cast away in the forest,
many are those who envy you,
as hell-beings do,
those headed for heaven.
The monk, chastened by the devata, came to his senses. ~~ SN 9.9 ~~
To have many friends, one needs to get others involved in good deeds. But being alone isn't always a bad thing. Especially if you can't find good friends.
Should a seeker not find a companion who is better or equal, let him resolutely pursue a solitary course; there is no fellowship with the fool. - Dhammapada(Balavagga) -61
If you do good deeds and dedicate them to attaining Nibbana, you will be born in places where you can hear the Dhamma and get to meet enlightened beings or at least those who teach the Dhamma. What better association than that?
Kamma is just one cause of happenings ,not the only cause of everything bad or good happened.
You didn't have friends the day you were born. By your good/bad actions you gain/lose friends.