Most fish will defend their place of refuge vigorously, particularly if shelter is in short supply. The physical characteristics of a potential aggressor's tankmates may determine how it behaves toward them. In their natural environment, reef fish do not indiscriminately attack every fish they encounter, but instead are selective about who they are aggressive toward. For example, the white-tail damselfish primarily attacks intruders that compete with it for food. Studies have shown that shape, color and behavior are characteristics fish use to recognize their own and other species.
Shape is often indicative of the feeding behavior of a fish.
Herbivores tend to have a deeper, flatter shape than carnivores, which are built for speed and tend to be more elongate and streamlined. Therefore, instead of being able to recognize every species that enters its territory, the damsel is able to predict, with a great degree of accuracy, the feeding habits of the intruding species by its shape. Color can also elicit aggression. Butterflyfish use color pattern to recognize members of their own species. Some fish not only cue in on shape and color but also on behavioral characteristics.