How does wishful thinking (the ‘desirability bias’) work? Existing theories (e.g., cognitive dissonance, motivated reasoning, psychological immune theory) struggle to adequately explain this phenomenon, so I apply theory construction methodology and standard critical thinking tools to improve on them. I find that wishful thinkers accurately perceive that attaining self-serving beliefs will confer genuine benefits to them, but underperceive their potential costs, leading to a distorted perception of the true personal benefit-cost ratio (BCR). Wishful thinkers must also maintain their beliefs over time, which they achieve with the strategic avoidance of doubt-inducing stimuli (even though this strategy has fundamental constraints). I posit that wishful thinking necessarily produces an aversive attitude towards self-doubt, and that such doubt aversion is a crucial causal factor: the overperception of the BCR of wishful thinking is locked in by it, as it obstructs future learning about costs. All of this produces serious risks for the wishful thinker, but they may reduce their exposure to these by developing conditional metacognitive knowledge about self-doubt. Unfortunately, doubt aversion can again obstruct this process. My main contention is that without the metacognitive neglect (i.e., the failure to develop metacognitive knowledge) of self-doubt and doubt aversion, wishful thinking could not be sustained.