According to the selfish herd theory, a group forms as individuals try to reduce their domain of danger by approaching others and continuously moving toward the center of the group where the risk of predation is the lowest.