A Potpourri of Pooches explains how canine variety is a product of artificial selection by humans:
It’s not known exactly when people and pups first got together, but it was a long time ago. The first archeological evidence of dogs morphologically distinct from wolves comes from roughly 12,000 years ago in the Middle East. By that time and perhaps much earlier — Wayne’s genetic data hint that dogs split from wolves about 135,000 years ago — dogs appear to have been at least semi-domesticated. By 2000 B.C., dogs resembling the modern pharaoh hound are depicted on Egyptian tombs, implying that both domestication and diversification were well under way.For the next few thousand years, right up until the late 19th century, people bred dogs for certain skills: running down prey (greyhounds), hunting rodents in holes (terriers), flushing and fetching game (pointers and retrievers). It wasn’t until the late 1800s, when kennel clubs first formed, that breeding for appearance rather than behavior began in earnest. Pure-breeding started then as well: to be registered as a purebred giant schnauzer, both your parents had to be registered as giant schnauzers. Breeders bent on designing the perfect breed are indubitably the reason why today we have dogs as divergent as the long-faced borzoi and squashed-faced bulldog, the Mexican hairless and lavishly hirsute Pekingese, the 150-pound St. Bernard and two-pound Chihuahua.