Natural selection can favour ‘irrational’ behaviour