Fifty years ago, the American psychologist Leon Festinger infiltrated a group who believed the world would end on December 21. How would they feel on December 22? Would they reject the prophet who had fed them such lies?

Quite the opposite. And it was those who had invested most in their belief, selling their houses and giving away their money, who now became the most fervent disciples.

Festinger explained this all-too-human need to justify past actions as driven by something he termed "cognitive dissonance" - the state of tension that occurs whenever we hold two "cognitions" (ideas, beliefs, opinions) that contradict each other.

How we relieve that tension to achieve consonance is what this excellent book is about, and the authors, who are social psychologists, offer a topical example. You support your leader and back his invasion of Iraq, but then you learn that the weapons of mass destruction of which he spoke so persuasively never existed. How then to achieve consonance?

Easy. You refuse to accept the absence of WMDs (they'll turn up - see if they don't), and when all hope fades, you argue that there were other equally compelling reasons to invade anyway, such as the need to impose democracy and eradicate terrorism.

The leader in question, this being an American book, is of course George Bush. But UK readers who wish to substitute Blair for Bush may rest assured that the argument loses nothing in the translation. Indeed, when the authors need to sum up the mechanics of self-justification in one pithy line, it is a British politician, Lord Molson (1903-1991), who provides the soundbite: "I will look at any additional evidence to confirm the opinion to which I have already come."

MRI scans confirm that when we are confronted with dissonant information, the reasoning areas of our brains all but shut down. And it's not only politicians who indulge in self-justification. For which of us, on buying the more expensive appliance, has not then spent weeks kidding ourselves the cheaper model would have been unreliable or downright dangerous?

But how do we square two dissonant cognitions when one of them is the belief that we are decent people and the other is the knowledge that we have inflicted pain on an innocent victim?

Ask any kid who wallops a younger brother. "I'm decent, but I hit him," the argument runs, "therefore he must have deserved it." It's the most vicious of circles. Aggression begets self-justification, which begets more aggression, and thus do the authors lead us, one small step at a time, down the road to Abu Ghraib and to all those deeds throughout the ages whose doers were never the monsters we'd prefer them to be but just decent people like us.

And at the end of the day, when the time comes for decent people to tell their story, self-justification is left holding the pen. Memory, say the authors, becomes our live-in historian - which is alarming given what psychologists now know about memory's shortcomings.

For recovering our memories is not like replaying a tape. Rather, we're told, it's "like watching a few unconnected frames of a film and then figuring out what the rest of the scene must have been like". And given our need for consonance, it is natural we should reconstruct our memories to fit a storyline, thereby saving ourselves from "the embarrassment of actions we took that are dissonant with our core images".

"If mistakes were made," say the authors, "memory helps us remember that they were made by someone else." Which is an observation so shrewd it should appear, like a health warning, on the cover of every autobiography and political memoir on sale to the public.