Evolutionary origins of modeling minds