The rational capacity of human mind - i.e. the capacity to analyze and discover how things in reality are connected and what causes what - is clearly beneficial for food procurement and escaping imminent danger. However, its benefit for enduring harsh reality is at least dubious. Being keenly aware how much the world around us sucks is likely to produce depression and the lost of will to live, if not to off oneself altogether.
On the other hand, the delusional capacity of the human mind would come very handy in situations requiring endurance. The panglossian view of harsh reality or a belief that such reality is, after all, malleable by human powers (such as pleading bribing, denial, magic, will power etc.) could help people survive through the harsh times.
Our pre-historical ancestors spent most of their time on enduring the harsh reality - hunger, the elements, and dangerous animals, while the amount of time spent on the actual procurement of food or escaping imminent danger was only a fraction of the enduring time. Therefore, having greater biological capacity to delude oneself translated into a greater chance of survival and transmitting the genes responsible for delusional tendencies on the progeny. Hence the delusional thinking seems to be more prevalent than rational thinking today.
Wojtek