Behavior is considered social only within groups of the same species, with a certain level of interaction beyond just being around each other. Therefore, some herds are considered social, such as horses or wolfpacks, and some are not, such as impalas or flocks of many types of birds. Some of the advantages of social behavior are just advantages of "hanging out in groups."
There are simple defensive advantages that derive from just being in a group: each individual may just be looking out for itself, but the others can be alert not just for predators, but for other individuals' response to detected predators. So when a bird on the edge of a flock detects danger and takes off, it is not purposely alerting the others, but they will probably take to the air as well. This makes it much harder for predators to sneak up on a group than an individual. A case could be made for safety in numbers: when an individual is taken, the odds of any individual being the unlucky one are associated with the number of individuals around it.
There are reproductive advantages to associating with a group: there are available mates. In groups with no established heirarchy of mate access (covered below), it is not unusual for there to be a high level of synchronicity of fertility in a group, where all of the females are "in heat" at the same time. Males may compete for access, but that competition is spread out, as opposed to a large group with just one female in heat at any given time. In humans, when many adult females live in close proximity, their fertility cycles tend to synchronize - the dormitory effect - which may be a holdover from our distant ancestors (recent studies have thrown some doubt on this phenomenon).
Social groups are often biological colonies , with members within the group doing different jobs to support the group or groups within the groups. Some biologists treat these groups as superorganisms. Evolution may select useful features, but there may be many useful features in a colony, and is the colony itself an evolving unit? Going back to Darwin's time, some people used that idea to justify the subjugation of indigenous populations by "superior" Western cultures, and the concept of group selection was abandoned. It still is considered controversial and treated as a non-factor by many evolutionary biologists.
Cooperation becomes a major element of social interaction within colonial species. This may include the search for food, the protection of the group, or the construction of housing, as done for example by bees, ants, or humans.
There are disadvantages to grouping bahavior, reflected in advantages of solitary behavior. For instance, camouflage works well for individuals, but not really for groups. When food is difficult to find and can't be shared, it's better to get it by yourself, as snakes do. When food is very limited, it's easier to feed individuals than groups. When there is an abundance of food, groups still tend to exhaust it locally, giving an advantage to populations spread through the ecosystem. In general, the carrying capacity of an ecosystem - how many individuals of a particular species it can sustain indefinitely - is higher for solitary species than grouping species.
Although solitary species may have a more difficult time matching up mating pairs, the reproductive exclusivity can be advantageous, with a lack of conflict and surer parenting. The sure-parenting aspect can be especially important when parents cooperate in the care of the young - there's only a premium for the father putting in the effort if he's helping his own offspring.