In sociology, a group is usually defined as a number of people who identify and interact with one another. This is a very broad definition, as it includes groups of all sizes, from dyads to whole societies. While an aggregate comprises merely a number of individuals, a group in sociology exhibits cohesiveness to a larger degree. Aspects that members in the group may share include: interests, values, ethnic/linguistic background, roles and kinship. One way of determining if a collection of people can be considered a group is if individuals who belong to that collection use the self-referent pronoun "we;" using "we" to refer to a collection of people often implies that the collection thinks of itself as a group. Examples of groups include: families, companies, circles of friends, clubs, local chapters of fraternities and sororities, and local religious congregations.
Collections of people that do not use the self-referent pronoun "we" but share certain characteristics (e.g., roles, social functions, etc.) are different from groups in that they usually do not regularly interact with each other nor share similar interests or values. Such collections are referred to as categories of people rather than groups; examples include: police, soldiers, millionaires, women, etc.
Individuals form groups for a variety of reasons. There are some rather obvious ones, like reproduction, protection, trade, protest, and food production. But social categorization of people into groups and categories also facilitates behavior and action. An example may help explain this idea:
Suppose you are driving somewhere in a car when you notice red lights flashing in your rearview mirror.
Because you have been socialized into society, you know that the red lights mean you should pull over, so you do. After waiting for a minute or two, an individual in a uniform walks toward your car door. You roll down your window and the individual asks you for your "license and registration. "Because groups and categories help facilitate social behavior, you know who this individual is: a member of a law enforcement category like the police or highway patrol. In all likelihood, you do not have to question this individual as to why they are driving a special car with lights on it, why they are wearing a uniform, why they are carrying a gun, or why they pulled you over (you may ask why they pulled you over, but doing so often increases the likelihood they'll give you a ticket). In short, because you recognize that the individual driving the car belongs to a specific social category (or group), you can enter this interaction with a body of knowledge that will help guide your behavior. You do not have to learn how to interact in that situation every single time you encounter it.
In fact, sociologists have long recognized the people experience much of social life by attempting to frame situations in terms they can understand. Specifically, people approach each situation by consciously or unconsciously asking "What is going on here," and seeking to coordinate their activities to the "definition of the situation" they decide upon. To accomplish this, people scan situations for information "given" (e.g., the things people do to signify who they are and what groups they belong to intentionally) and "given off" (e.g., the things people do that inadvertently signify who they are and the groups they belong to) by other people in the situation. Based on this information, people then act in ways they have been socialized to believe is appropriate for the situation. In the case above, for example, you (as the driver) would note the information given (e.g., the special car, the lights, and the uniform worn) to ascertain what was happening and who the other driver was, and then you could note the information given off (e.g., the apparent mood of the police officer based upon her or his body language, verbal language, and mannerisms) to predict (accurately or otherwise) what was about to happen to you. In so doing, you would be using the knowledge of groups at your disposal to manage the situation. Such interpretive work combined with social categorizations to smooth a wide variety of interactional and interpretive experiences.