It is called prospect theory, and it was developed by Daniel Kahneman and Amos Tversky. What the theory claims is that evaluations are relative to a baseline. A given experience will feel positive if it's an improvement on what came before and negative if it's worse than what came before.