Social groups are what we exist in and comprise our friends and family. Social groups can be a sign of personal strength and they can help us feel as though we are part of a community and supported by a network of people. While most of this is good groups are also a place where people seek to obtain their needs and therefor there is both a positive and negative aspect to groups.
There is a saying that your 5 closest friends sum up who you are (or something like that). I think this to be only partially true. Certainly we attract people that similarities in interest and needs. However, as we get to know each other we change each other and impact each other's personalities.
The friends we keep do become a reflection on us and we should be sure to choose good friends when we can. Friends are for different things. Some friends are for fun, some are for closeness, some for sports, some for convenience. Knowing which friends are for what will help you navigate the pitfalls of friendship.
It is beneficial not to be naive. Good friends want what is in your best interest but most people have their own interests in mind. There may be social rules in place but there are also plenty of people who will violate those rules in order to get what they want. As these incidence occur you should adjust your friendship strategies to draw closer good people and back off those who you might consider to be toxic.
Social groups come from our deep needs to be within a community. Pre-modern man worked in small groups and tribes in order to obtain his needs. Community orientation was beneficial for survival. While we don't hunt in groups we do obtain our needs in groups. The social rules are important for social cohesion.
When someone violates these rules they are basically stating their needs are important than another person. Sometimes they are willing to violate people's boundaries to anyone they think they can get away with it. Other times it might be a specific person. Having confidence, maintaining strong social connections, and knowing when to confront or back off is important. The nature of man is good and bad all mixed up on the same person. Some lean a little more in one direction while other lean in another. The more socially skilled you become the better able you are to determine between the two.