Maybe you’ve experienced this at school or work before: Dealing with someone who thinks he’s much better at his job than he really is. This can not only be really annoying, but it can lead to disaster as a group project is made much more difficult by someone’s unchecked ego.

A new TED-Ed video, based on a lesson by psychologist David Dunning, dives into why this happens and why people are so bad at judging their skills in general, looking into the phenomenon known as the Dunning-Kruger effect.

“Knowing how competent we are and how our skills stack up to other people’s is more than a self-esteem boost,” narrator Addison Anderson explained. “It helps us figure out when we can forge ahead on our own decisions and instincts and when we need, instead, to seek out advice.”

“But,” Anderson added, “psychological research suggests that we’re not very good at evaluating ourselves accurately. In fact, we frequently overestimate our own abilities.”

This is true “to a degree that violates the laws of math.” For example: “When software engineers at two companies were asked to rate their performance, 32 percent of the engineers at one company and 42 percent at the other put themselves in the top 5 percent.”

So what’s going on here? There’s actually a reasonable explanation: “When psychologists Dunning and [Justin] Kruger first described the effect in 1999, they argued that people lacking knowledge and skill in particular areas suffer a double curse. First, they make mistakes and reach poor decisions. But second, those same knowledge gaps also prevent them from catching their errors. In other words, poor performers lack the very expertise needed to recognize how badly they’re doing.”

For example, how can someone know he’s a bad writer if he doesn’t know even basic spelling and grammar rules?

The good news is once people know they are bad at something — say, if they fail at a logic puzzle — they’ll typically admit to it. But some level of experience or expertise is needed for a person to come to that realization.

“That may be why people with a moderate amount of experience or expertise often have less confidence in their abilities,” Addison said. “They know enough to know that there’s a lot they don’t know.”

But knowledge can also lead to people overestimating others: “Experts tend to be aware of just how knowledgeable they are. But they often make a different mistake: They assume that everyone else is knowledgeable too.”

“The result is that people, whether they’re inept or highly skilled, are often caught in a bubble of inaccurate self-perception,” Addison explained. “When they’re unskilled, they can’t see their own faults. When they’re exceptionally competent, they don’t perceive how unusual their abilities are.”

There’s a way to prevent all of this: “First, ask for feedback from other people — and consider it, even if it’s hard to hear. Second, and more important, keep learning. The more knowledgeable we become, the less likely we are to have invisible holes in our competence.”

Keep in mind this is all just one explanation for why and how incompetent people may overestimate themselves. For examples of other explanations, check out a good rundown by psychologist Tal Yarkoni.