Recognizing relatives is an essential aspect of sexual reproduction, the point of which is to engender genetic diversity, to raise the probability that some individuals survive when others in a population may not. When it comes to sex, kin recognition prevents inbreeding, which is a biological taboo of both plants and animals.
Sociality presents a different context. Being conscious of clan cultures camaraderie. Shared heredity give rise to common cause. The basis for cooperative behaviors of every kind come from kin recognition.
It is a tiny leap in the mind of an organism to translate biology into the broader frame of association called attraction. Kinship is only one side of the coin of comity.
The flip side is mating. Promoting genetic diversity requires accepting outsiders and making them family, for at least some duration.
Hence, all sociality has a genetic genesis which translates into innate behaviors and mental constructs. From cooperation to war, biology brackets all social expressions.