When talking group affinity, there are usually several categories one can use.
Universally among humans, but also among monkeys, and many other mammals and birds, there is a distinction between Kin and non-kin.
I am personally unfamiliar with any further group of humans that do not recognize the second category of friend.
Also...there is a universal category of tribesmates, which I think translates into "members of my community"... but doesn't translate cleanly, largely for Dunbar-number reasons. I label this as close acquaintances.
And then...there are a whole bunch of categories that some people notice, and other people don't.
Crazily, some people give a shit about which patch of ground you were born on. Other crazy people give a shit about what color you are. What language you were taught growing up. What sky-god or earth-mother your parents taught you to obey. Which school your great grandparents went to. What gender your god constructed you to find physically attractive.
I mean ... I'm sure someone is benefitting from tricking all sorts of folks into caring about groups that are irrelevant to that person's life. Making us-them distinctions has usually created group-cohesion benefits mostly for the tribe's leaders, and has the added benefit of making a whole bunch of dumbasses do what the leaders say, for fear of "the other".
I consider it the most dangerous psychological force on the planet. Smart, unscrupulous people playing on idiots group-belonging-ism.
I'm sure someone will bring up the quote I can't remember about liberals and groups. I prefer Bryan Caplan's phrasing:
Family, Friends, Acquaintances, Strangers. 4 categories. Only 4 categories. All the other ones are bullshit that someone is using to screw with your loyalties...and move them off the sane 4-categories.