The Dunning–Kruger effect is a cognitive bias in which people reach erroneous conclusions and make unfortunate choices but their incompetence robs them of the metacognitive ability to realise it.
The unskilled therefore suffer from illusory superiority, rating their own ability as above average, much higher than in actuality; by contrast, the highly skilled underrate their abilities, suffering from illusory inferiority.
This leads to a perverse result where less competent people will rate their own ability higher than more competent people.
It also explains why actual competence may weaken self-confidence because competent individuals falsely assume that others have an equivalent understanding.
Thus, the miscalibration of the incompetent stems from an error about the self, whereas the miscalibration of the highly competent stems from an error about others.