When we lived in Thies, Senegal, herders ran their cattle by the front of our house to move them to the pasture suited to the season. Several groups of cattle had dogs that were part of the herd. I wondered how they got the dogs to stay with the of cattle. (Full disclosure: I was never able to get a picture of the Thies, Senegal cattle dogs. The one attached to this post is a composite.)

The Beersheba Project tried to get their dogs to guard remote areas of the property, but the dogs just wanted to hang out at the dining hall. Brenda R. in Johannesburg, South Africa told us about a project to use Anatolian Sheep dogs to run with the goat herds to prevent cheetah predation. Anatolian sheep dog as protection from cheetahs As a result, I was quite interested when I read an account by Charles Darwin in “The Voyage of the Beagle” of how the feat was accomplished in the mid 19th century in the Patagonian Pampas.
“While staying at this estancia, I was amused with what I saw and heard of the shepherd-dogs of the country. When riding, it is a common thing to meet a large flock of sheep guarded by one or two dogs, at the distance of some miles from any house or man. I often wondered how so firm a friendship had been established. The method of education consists in separating the puppy, while very young, from the bitch, and in accustoming it to its future companions. An ewe is held three or four times a day for the little thing to suck, and a nest of wool is made for it in the sheep-pen; at no time is it allowed to associate with other dogs, or with the children of the family. The puppy is, moreover, generally castrated; so that, when grown up, it can scarcely have any feelings in common with the rest of its kind. From this education it has no wish to leave the flock, and just as another dog will defend its master, man, so will these the sheep.
It is amusing to observe, when approaching a flock, how the dog immediately advances barking, and the sheep all close in his rear, as if round the oldest ram. These dogs are also easily taught to bring home the flock, at a certain hour in the evening. Their most troublesome fault, when young, is their desire of playing with the sheep; for in their sport they sometimes gallop their poor subjects most unmercifully. The shepherd-dog comes to the house every day for some meat, and as soon as it is given him, he skulks away as if ashamed of himself. On these occasions the house-dogs are very tyrannical, and the least of them will attack and pursue the stranger. The minute, however, the latter has reached the flock, he turns round and begins to bark, and then all the house-dogs take very quickly to their heels. In a similar manner a whole pack of the hungry wild dogs will scarcely ever (and I was told by some never) venture to attack a flock guarded by even one of these faithful shepherds.”