But in general, people deal with cognitive dissonance — the clashing of conflicting thoughts — by eliminating one of the thoughts. The notion that the toaster is desirable conflicts with the knowledge that you just passed it up, so you banish the notion. The cognitive dissonance is gone; you are smug.

Of course, when you see others engaging in this sort of rationalization, it can look silly or pathological, as if they have a desperate need to justify themselves or are cynically telling lies they couldn’t possibly believe themselves. But you don’t expect to see such high-level mental contortions in 4-year-olds or monkeys.

As the Yale researchers write, these results indicate either that monkeys and children have “richer motivational complexity” than we realize, or our ways of dealing with cognitive dissonance are “mechanistically simpler than previously thought.” Another psychologist, Matthew D. Lieberman of the University of California, Los Angeles, suggests it’s the latter.

“If little children and primates show pretty much the same pattern you see in adults, it calls into question just how deliberate these rationalization processes are,” he says. “We tend to think people have an explicit agenda to rewrite history to make themselves look right, but that’s an outsider’s perspective. This experiment shows that there isn’t always much conscious thought going on.”

The new results jibe with those of a dissonance experiment that Dr. Lieberman and colleagues did with amnesiacs, people with impaired short-term memories, who were asked to rank an assortment of paintings. Then they chose among selected ones and ranked the whole group again. By the second time they ranked the paintings, they couldn’t consciously recall their earlier rankings or their choices, so they presumably didn’t have a psychic need to rewrite history.

Yet they showed as much new disdain for the paintings they’d rejected as did a control group with normal memories. Apparently, the rejections registered in some unconscious way, so that the amnesiacs rationalized their decisions even though they couldn’t remember them.

The compulsion to justify decisions may seem irrational, and maybe petty, too, like the fox in Aesop’s fable who stopped trying for the grapes and promptly told himself they were sour anyway. But perhaps Aesop didn’t appreciate the evolutionary utility of this behavior for humans as well as animals.