Cognitive dissonance is a psychological term describing the uncomfortable tension that may result from having two conflicting thoughts at the same time, or from engaging in behavior that conflicts with one's beliefs, or from experiencing apparently conflicting phenomena.
In simple terms, it can be the filtering of information that conflicts with what you already believe, in an effort to ignore that information and reinforce your beliefs.
In detailed terms, it is the perception of incompatibility between two cognitions, where "cognition" is defined as any element of knowledge, including attitude, emotion, belief, or behavior.
The theory of cognitive dissonance states that contradicting cognitions serve as a driving force that compels the mind to acquire or invent new thoughts or beliefs, or to modify existing beliefs, so as to reduce the amount of dissonance (conflict) between cognitions.
Experiments have attempted to quantify this hypothetical drive.
Some of these have examined how beliefs often change to match behavior when beliefs and behavior are in conflict.