The dog job of herding started over 10,000 years ago. The American Kennel Club currently recognizes30 herding breedsthat have come out of humans breeding dogs with the best herding instincts, skills, and agility.
Domesticating livestock proved to be important in the survival of humans and dogs, making food sources more readily available and abundant. Once the herds of livestock became common, dogs were given the job of livestock guardians, protecting flocks from predators and getting any stragglers back with the group.
The herding instinct can be very strong with some breeds, going so far as to display some herding behaviors with humans. While not ideal, owners can distract the dog with stimulating brain activities and more importantly, a lot of physical activity. Herding dogs naturally have a lot of energy and they need to expel it. One great way isTreibball, where dogs “herd” large fitness balls around an area.
More information on herding dogs can be found here.