Understanding the origin and adaptive value of a behavioral trait requires not only knowledge of phylogenetic relationships of the organism in question but also consideration of the nature of the environment in which the trait may have arisen (and in which the trait persists) together with consideration of the internal state of the organism, both of which can affect patterns of response to the environment. For insects, the behaviors of greatest relevance to survival and reproductive success are probably those associated with acquisition of essential resources such as food, mates, and egg-laying sites and those associated with defense against natural enemies.