Here's something I wrote for a (now-closed) veterinary clinic's blog about 8 years ago:
The History of the Domestic Dog
The domestic dog, (Canis familiaris) has been a loyal companion to human beings for thousands of years; but until relatively recently, nobody knew with any certainty exactly where the species came from. It was clear that the dogs we love evolved from other canid species from the Canidae family, but whether that meant that our dogs are descendants of wolves, jackals, foxes, or coyotes was an open question until the late 1990's. The application of modern DNA sequencing techniques finally proved without any doubt that all domestic dogs are descendants of wolves, and specifically, of the Grey Wolf (Canis lupus), making them Canis lupus familiaris.
Based on the archeological evidence, it appears that human beings formed social relationships with dogs long before they even became the domesticated species known today as Canis familiaris. That evidence includes ancient burial plots containing two human skeletons and a dog-like skeleton in Germany dating back to 14,000 years. Meanwhile, the famous Chauvet caves in France provide archeological evidence of human-dog relationships in some of the earliest known human footprints on the European Continent. In particular, the 26,000 year-old footprints of a child are preserved next to those of an animal whose paw prints clearly indicate that it was an intermediate species of canid that had not yet evolved into a domestic dog.
The other fascinating fact about dogs is that all modern breeds of dogs are actually genetically identical. This means that the largest Great Dane, the smallest Yorkshire Terrier, and every other dog in between are the exact same animal except for their external physical features and behavioral tendencies for which we have selected in breeding them. That may seem surprising until you consider that domestic dogs share more than 99.9% of their genes with their wolf ancestors. Still, DNA only answers the question of genetic identity and physiology without addressing the more interesting question about how dogs and humans formed their first relationships and social bonds.
By piecing together what we know about early human societies and canid behavior, evolutionary historians and archeologists theorize that the first canid-human relationships were formed when wolves began associating human settlements with a source of food. Initially, they probably remained at a safe distance from humans, only scavenging human food scraps at the fringes of their territory. Individual wolves who were less fearful than others probably began taking food from people more directly and eventually, some of their pups became familiar with people before they developed the natural fear of human beings that all wild adult wolves share.
The first "pet" wolves were likely those pups who were kept because they were the friendliest and least afraid of people. By "breeding" the friendliest wolves, early human beings actually conducted a form of artificial selection that produced more friendly wolf pups every generation. Believe it or not, all of the behavioral and obvious physiological differences between wolves and domestic dogs are attributable to breeding for particular physical traits and for behaviors desired by human beings in their pets. Domestic dogs are friendly and easily socialized to bond with humans precisely because we have continually bred individual dogs with those traits ever since. So the next time that you play with your friendly Golden Retriever, think about the fact that, genetically, your best friend is actually more than 99.9% Grey Wolf!