Basically, it comes down to diet for predators and safety for prey. If you have a diet of animals too big to kill solo, or have a predator that you easily find and kill you solo, you group up. If you eat small things, you won’t want to share. If your strategy is hiding or injuring predators, you often won’t want/need the safety of a herd.
Latest Answers