Avoiding predators and fighting for space, food and mates is a priority for every animal - but before attacking, they must be able to defend themselves.