The Dunning-Kruger effect in psychology is a bias among people (men?) of low skill. They consistently over-estimate their abilities. Perhaps because of their low skill/knowledge in a field they don’t even realize just how poor theirs is. And their over-estimation gives them more confidence.
And many people are attracted to people with high confidence. Someone who says “I know what to do!” is generally more convincing and appealing than someone who says “It’s complex. I will have to think about that and get back to you.”
So low skill/high confidence people often are more appealing, and can make a better sales pitch, than the truly highly skilled. This is especially true when selling to people who don’t have an expertise in the particular area in which they’re hiring, or buying, or voting.
And so the incompetent is hired, or closes the deal, or wins the election.
It’s just another example of how our emotions, rather than reason, often guide our actions.
BTW, a corollary to the Dunning-Kruger effect is that people of high skill tend to under-estimate their abilities; they know how much they don’t know and are more humble.