Charles Darwin observed that “ignorance more frequently begets confidence than does knowledge.” That was certainly true on the day in 1995 when a man named McArthur Wheeler boldly robbed two banks in Pittsburgh without using a disguise. Security camera footage of him was broadcast on the evening news the same day as the robberies, and he was arrested an hour later. Mr. Wheeler was surprised when the police explained how they had used the surveillance tapes to catch him. “But I wore the juice,” he mumbled incredulously. He seemed to believe that rubbing his face with lemon juice would blur his image and make him impossible to catch.

In movies, criminal masterminds often are geniuses, James Bond villains in volcano lairs. But the stereotype doesn’t apply to actual cons, at least not the ones who get caught.

Studies show those convicted of crimes are, on average, less intelligent than non-criminals. And they can be spectacularly foolish. One of us had a high school classmate who decided to vandalize the school — by spray painting his own initials on the wall. A Briton named Peter Addison went one step further and vandalized the side of a building by writing “Peter Addison was here.” Sixty-six-year-old Samuel Porter tried to pass a one-million-dollar bill at a supermarket in the United States and became irate when the cashier wouldn’t make change for him. All of these people seem to have been under what we call the “illusion of confidence,” which is the persistent belief that we are more skilled than we really are — in this case, that the criminals were so good they would not get caught.

The story of McArthur Wheeler was told by social psychologists Justin Kruger and David Dunning in a brilliant paper entitled “Unskilled and Unaware of It.” In a set of clever experiments, Kruger and Dunning showed that people with the least skill are the most likely to overestimate their abilities. For example, they measured people’s sense of humor (psychologists have learned that almost anything can be measured) and found that those who scored the lowest on their test still thought they had a better-than-average sense of what is funny.

These findings help to explain why shows like “American Idol” and “Last Comic Standing” attract so many aspiring contestants who have no hope of qualifying, let alone winning. Many are just seeking a few seconds of TV time and a shot at “Pants on the Ground” fame, but some seem genuinely shocked when the judges reject them.

It turns out that the illusion of confidence can survive even the measurement of skill.

Chess, for instance, has a mathematical rating system that provides up-to-date, accurate and precise numerical information about a player’s “strength” (chess jargon for ability) relative to other players. Ratings are public knowledge and are printed next to each player’s name on tournament scoreboards. Ratings are valued so highly that chess players often remember their opponents better by their ratings than by their names or faces. “I beat a 1600” or “I lost to a 2100” are not uncommon things to hear in the hallway outside the playing room.

Armed with knowledge of their own ratings, players ought to be exquisitely aware of how competent they are. But what do they actually think about their own abilities? Some years ago, in a study we conducted with our colleague Daniel Benjamin, we asked a group of chess players at major tournaments two simple questions: “What is your most recent official chess rating?” and “What do you think your rating should be to reflect your true current strength?”

As expected, all of the players knew their actual ratings. Yet 75% of them thought that their rating underestimated their true playing ability. The magnitude of their overconfidence was stunning: On average, these competitive chess players estimated that they would win a match against another player with the exact same rating as their own by a two-to-one margin — a crushing victory. Of course, the most likely outcome of such a match would be a tie.

This tendency for the least skilled among us to overestimate their abilities the most has more serious consequences than an inflated sense of humor or chess ability. Everyone has encountered obliviously incompetent managers who make life miserable for their underlings because they suffer from the illusion of confidence. And as the joke reminds us, the people who graduate last in their medical school class are still doctors; what is less funny is that they probably believe they are still the best ones.

Daniel Simons and Christopher Chabris are the authors of “The Invisible Gorilla, and Other Ways Our Intuitions Deceive Us” (Crown). Visit their website at theinvisiblegorilla.com.