Cognitive dissonance theory warns that people have a bias to seek consonance among their cognitions. According to Festinger, we engage in a process he termed "dissonance reduction", which he said could be achieved in one of three ways: lowering the importance of one of the discordant factors, adding consonant elements, or changing one of the dissonant factors. This bias gives the theory its predictive power, shedding light on otherwise puzzling, irrational, and even destructive behavior.
A classical illustration of cognitive dissonance is expressed in the fable The Fox and the Grapes by Aesop (ca. 620–564 BCE). In the story, a fox sees some high-hanging grapes and wishes to eat them. When the fox is unable to think of a way to reach them, he decides that the grapes are probably not worth eating, with the justification the grapes probably are not ripe or that they are sour (hence "sour grapes"). This example follows a pattern: one desires something, finds it unattainable, and reduces one's dissonance by criticizing it. Jon Elster calls this pattern "adaptive preference formation".
Link