The act of predation can be broken down into a maximum of four stages: Detection of prey, attack, capture and finally consumption. The relationship between predator and prey is one that is typically beneficial to the predator, and detrimental to the prey species. Sometimes, however, predation has indirect benefits to the prey species, though the individuals preyed upon themselves do not benefit. This means that, at each applicable stage, predator and prey species are in an evolutionary arms race to maximize their respective abilities to obtain food or avoid being eaten. This interaction has resulted in a vast array of adaptations in both groups.