Animal foraging behavior (or simply foraging) is an aspect of the animal feeding behavior in natural environments, where various activities are undertaken in order to search for, identify and catch food, and include behaviors concerned with its handling and storage.

Foraging theory is a branch of behavioral ecology that studies the foraging behavior of animals in response to the environment in which the animal lives. Foraging theory considers the foraging behavior of animals in reference to the payoff that an animal obtains from different foraging options. Foraging theory predicts that foraging options that deliver the highest payoff, should be favoured by foraging animals because it will have the highest fitness payoff.

Robert MacArthur and Eric Pianka, and in an independent paper J M Emlen in 1966, first proposed an optimal foraging theory, arguing that because of the key importance of successful foraging to an individual's survival, it should be possible to predict foraging behaviour by using decision theory to determine the behaviour that would be shown by an "optimal forager" - one with perfect knowledge of what to do to maximise usable food intake. While the behaviour of real animals inevitably departs from that of the optimal forager, optimal foraging theory has proved very useful in developing hypotheses for describing real foraging behaviour. Departures from optimality often help to identify constraints either in the animal's behavioural or cognitive repertoire, or in the environment, that had not previously been suspected. With those constraints identified, foraging behaviour often does approach the optimal pattern even if it is not identical to it.

There are many versions of optimal foraging theory that are relevant to different foraging situation. These include:

The optimal diet model, which describes the behaviour of a forager that encounters different types of prey and must choose which to attack

Patch selection theory, which describes the behaviour of a forager whose prey is concentrated in small areas with a significant travel time between them

Central place foraging theory, which describes the behaviour of a forager that must return to a particular place in order to consume its food, or perhaps to hoard it or feed it to a mate or offspring.

In recent decades, optimal foraging theory has frequently been applied to the foraging behaviour of human hunter-gatherers. Although this is controversial, coming under some of the same kinds of attack as the application of sociobiological theory to human behaviour, it does represent a convergence of ideas from human ecology and economic anthropology that has proved fruitful and interesting.