Emotions are Nature’s incentive schemes getting us to do what’s in our evolutionary interest.  But unlike the textbook principal-agent relationship, there is no intrinsic conflict of interest.  The principal gets to design the agent, essentially dictating the terms of the contract. However, in practice the contract is incomplete.  Instead of being programmed with an exhaustive set of instructions for every contingency we are designed to respond to emotions.

This second-best solution has its costs.  For example, fear can kill you.  In fact, your enemies can scare you to death.