Humans selected dogs that performed specific tasks, such as herding.