http://cdp.sagepub.com/content/12/3/83.abstractSuccessful negotiation of everyday life would seem to require people to possess insight about deficiencies in their intellectual and social skills. However, people tend to be blissfully unaware of their incompetence. This lack of awareness arises because poor performers are doubly cursed: Their lack of skill deprives them not only of the ability to produce correct responses, but also of the expertise necessary to surmise that they are not producing them. People base their perceptions of performance, in part, on their preconceived notions about their skills. Because these notions often do not correlate with objective performance, they can lead people to make judgments about their performance that have little to do with actual accomplishment.
Abstract for the concept with the full text attached.
Basically ignorance about a skill or knowledge about something tends to lead people into thinking they are doing a really good job at it.
In short ignorance and incompetence are directly correlated with overconfidence while having the knowledge seems to correlate with slightly underestimating how well one is doing.
These results have been extrapolated from many things from test taking to daily life.