Horde Mentality, known internally as a 'FollowOthersGoal', is the system that causes Spore Mobs to group together into large swarms, pairing up and following nearby allies.
Infected, Evolved (excluding Chargers), Bairns, Scampers, and Gastgebers can have an assigned 'partner'. They'll check every second if they have one. If they don't, they check for any nearby valid partners within a ~32 block radius. The closest one will be assigned as their partner. Mobs will only chose to partner with specific Mob tiers. The following are the parameters:
Infected and Bairns will partner with other Infected, Evolved, Hyper Evolved, Experiments, other Bairns, Scampers, Gastgebers, and Calamities.
Evolved (excluding Chargers), Scampers, and Gastgebers will partner with Infected, other Evolved, Hyper Evolved, Experiments, Bairns, other Scampers, other Gastgebers, and Calamities.
Hyper Evolved, Experiments, and Calamities will not partner with other Mobs, however other Mobs are able to partner with them.
Partners are never cleared, meaning once a Mob has a partner, they don't change it or get another.
While a Mob has a partner, they'll attempt to pathfind towards their partner every second. Every 10 ticks (half a second), they'll check to see if they're stuck and unable to reach their partner. If they are, they'll attempt to re-pathfind via a different route. Additionally, if their partner is at least 64 blocks away when they try to pathfind, they'll teleport to their location.
The icon for Horde Mentality.
Trivia
The hordes system used to be extremely outdated due to it being a very old feature. It was known to barely function and cause major performance issues. The entire system was eventually rewrote from the ground up to fix these problems.
The icon for Horde Mentality is recycled from a scrapped Mycelium Infection icon redesign.