In: Biology
Behavior of animals is a response to the environmental stimulus and it is genetically coded. For example, plants tend to grow towards light. Behavioral aspect of any organism is subjected to evolutionary processes like genetic drift and natural selection. Behavioral action can be studied in two aspects why the action happened (ultimate analysis) and how it is happened (proximate analysis).
For example, Male sticklebacks protect their eggs from red things (assuming all red things are male sticklebacks) by building some nest near shore. Actually they are protecting eggs from all kind of red things assuming it could be other male sticklebacks rather than male sticklebacks (Male sticklebacks have red coloured bellies only during mating season). Now proximate analysis is male sticklebacks protecting their eggs from red colour (visual cue) and ultimate analysis is they tend to protect their eggs from other male sticklebacks.