Among other things. It's just that they were bred for and excel at herding but these dogs wear many hats. The English shepherd can herd, guard and even hunt. The breed standard says one on one they should be able to take down a coyote which isn't exactly herding.
I've had collies from working lines that could herd and guard and protect. One went after someone breaking into our home. This same collie allowed a strange child to take a bone she was chewing out of her mouth when he wasn't sure it was safe for her to have it. (I had given it to her.)
Another went after a Doberman who was going after her little sheltie brother and sent him packing.
Bouviers and Briards are in the herding group and can herd, but they were also left with their flocks in remote places to protect as was the German Shepherd.
These are among the most versatile of dogs. In addition to being able to herd , some of my herding dogs are titled in obedience, tracking, and agility as well as being excellent protection dogs..