Numerous papers have tried to explain cognitive biases, such as optimism and overconfidence, from an evolutionary perspective. The attempts have met with mixed success. I identify why some approaches are more successful than others in explaining sub-optimal behaviours. I conclude that some evolutionary explanations of cognitive biases can be successful; the relevant explanation will depend on the particular bias being studied. In particular, I highlight the need to incorporate internal costs when considering the evolution of mental mechanisms, and how this can provide adaptive explanations of sub-optimal behaviours.