Collective Wisdom: An Evolutionary Perspective