When Homo came down from the trees that no doubt took countless thousands of years and eventually found living to be improved and stood up to see the view and perhaps view the sea he slowly found he had company. Wolf like animals of those days were perhaps pack animals as they are now but once in a while a few wolves out of the pack over came fear of humans because of several observations. From the wolf's point of view, it found an advantage in waiting near the humanoid family to wait for the eventual food from man's leftovers. Gradually the fear left an occasional one who followed the man-like creature who had to hunt for part of his livelihood finding that at the end of the hunt the man would "dress out" his game, leaving the offal or innards rather than carrying them for miles back to his home. Moreover a few wolf-like animals returned to feast on the leftovers. It must have been rewarding or it would not have happened and the strain that had lost enough fear gradually entered the hunt to the advantage of the human. Those camp follower-dogs actually entered into the hunt by following the particular game the human was running down. He could trail an antelope-like creature right through a heard of antelopes and the predator human could, with his slowly developed anatomy run with the dogs trailing the prey until it was exhausted and killed. One reason the fear was lessened was that eventually over, as I should repeat more often, over years of realization that the dog became an important part of the chase. It may have been a question of synergism by happenstance that the two creatures survived by cooperating in the acquisition of food in times of little plenty and of predators man could protect the dog from and the dog could warn the human of the approach of danger when man was sleeping.
As to the variation in our dogs the individuals with the scenting advantage was important as was the ability to run the distances required to run down game. We know man can run down most heard animals such as horses and we know dogs and modern wolves can do the same thing. Perhaps some isolated clans of humans found dogs that would point game and the hunter could approach and, with sling shot or arrow or whatever could capture the game. A dog with that capability would be of more value than used for food. Thus we have the pointing breeds of bird dogs for example. Our retrievers have traits that could have been of vital help in retrieving wounded game.
The treeing hounds could have been of great value in trailing and treeing game and announcing the capability by barking up the tree that had needed food for the human.
Slowly, with the human trait of bonding as with mother and her child came bonding of humans with dogs that were part of the bread winning of the partnership. Think of it, when a starving man is able to get food only with the help of a dog a gradual bonding was a most natural result. With bonding still an important human trait the Chihuahuas and so many others with the only reason for existence is the emotional and not the utilitarian side of the relationship.Too bad our ancestors took so long to learn to record the past for us. Medical science recognizes that sudden tranquility in humans can lower our blood pressure as watching an aquarium of tropical fish or by petting a dog. Amen for now.