Cognitive dissonance (CD) is the concept of holding two very different ideas in your mind at the same time. This is something all the great composers do when they think of two melodic themes and how they can intertwine, adapt and combine them. We would find it very difficult to whistle one tune while thinking of an entirely different one but that is the sort of thing that Beethoven or Mozart would consider trifling.
Let us take two different ideas:
1. Man created god(s), and the concepts of soul, afterlife, heaven & hell
2. Man wants everyday protection, eternal life & ultimate justice. All these are easily provided by a sky-daddy.
Both these ideas are scientific facts (except for the sky-daddy clause) established by cultural anthropology and Evolutionary psychology, but it is difficult to accept both of them at the same time. It would create cognitive dissonance and unease in the common man. To avoid CD people usually accept one and reject the other.
Some people who are science-savvy accept idea no.1, and feel that idea no.2 arose in the minds of our primitive ancestors because of the need to be safe from natural catastrophes & predators, fear of death & oblivion, and need for fair play. They feel that idea no.1 contradicts idea no.2. Such people are called Atheists.
On the other hand some others, in order to avoid CD, reject idea no.1 and accept idea no.2 as a bonus for their belief & trust in supernatural entities. They are called Theists.
Then you have the third category of people who, like Mozart or Beethoven, adroitly combine the two different melodies into one symphony. Such people are basically atheistic but wish to take over the duties of an absentee caretaker, to the extent humanly possible and help others to live their lives more happily. They say seeking the truth should prevail over search for comfort. Such folks are called Secular Humanists. They have resolved their CD, without forfeiting one idea for the other.