A lot has to do with imo intensity and prey drive more than 'herding'.
Well yes....that's
exactly what it is. It is a predatory behavior, one in the sequence of predatory motor patterns that people have strengthened by means of artificial selection when breeding border collies. It is used to herd sheep or other animals. The sequence or chain of predatory behaviors in border collies is orient, eye, stalk, chase and is at that point interrupted and stopped before they get to the behavior of grabbing, biting, killing, dissecting, consuming. A wolf, for instance would continue on and go through the entire sequence. BUT...a wolf would not have as intense or specialized eye stalk. Another breed of dog might go onto the next behavior in the sequence or the next few.
This interruption of the entire predatory sequence has to do with the fact that domestic dogs have evolved to be neotenic. That is, that they are juvenile versions of what might be their relatives. (might be) At any rate, they are as adults, in many ways what wild dogs are as puppies. Their brain chemistry..(hormone levels), skull, jaw, teeth and play behavior is that of a wild dog puppy. This manipulation by humans.... by way of selective breeding is assisted by the fact that they are probably neotenic counterparts of wild dogs. The on-set and off-set of adult brain development or maturity varies.
Incidentally, we are thought to be neotenic versions of other primates and we and dogs are two of VERY few species that have neotenic counter parts. We play more as adults than Chimpanzees, for instance. Dogs play more as adults than wild dogs in addition to other physical manifestations.