Animals feel agitation in stressful environments which causes the release of cortisol, leading to foraging and searching for food and mates. Dopamine is released when they catch the scent of something they need, while depression and disappointment signal the suppression of dopamine to avoid repeating mistakes.
Our neurochemical systems, including adrenaline, cortisol, dopamine, and epinephrine, were not designed to help us build Fortune 500 companies, but rather to be generic and adaptable depending on our circumstances, such as foraging for food or searching for a mate.
Neurochemical systems such as adrenaline, cortisol, and dopamine were not designed for specific purposes but to allow for adaptation to various circumstances, hence allowing animals to forage and succeed, and even avoiding repeating past mistakes.
The search for food and resources, driven by dopamine in the brain, has been present in animals, including humans, for tens of thousands if not hundreds of thousands of years. Dopamine rewards the search and discovery of resources and drives motivation to go out and forage, despite potential dangers.
Stress can lead to changes in the rat's brain and biology. These changes are evident in the defeat response that is characterized by depression and lack of motivation.
Although it would be advantageous to feel good all the time, our moods exist as a tool to navigate the variability of life and make choices that will lead to the highest payoff.