We had a livestock guardian dog, well bitch, about 11 stones worth, but she had not been raised as part of a flock. They need to have been raised by a mother who lives outside with the flock, so they grow up to that life from the start. Conna loved the sheep and was happy to defend them all day, but when the sun went in, so did she

. So no night time guarding. (Conna was born in a council house, along with her 11 brothers and sisters, so no sheep)
In fact LGDs work in packs. There was a lovely TV programme using infra red to watch what they did and how they saw off a pack of wolves, somewhere in southern Europe. I think there were six dogs, four stationed themselves on the edges of the flock as soon as they heard the wolves approaching, evenly spaced, including 'round the back' so no part was unguarded against a sneaky wolf. The other two stayed right in the centre of the flock to keep the sheep tight to them. When the wolves got close, all six dogs barked and barked - they have very big voices, and they jumped on their hind legs to look bigger. The wolves slunk off. Apparently, the dogs rarely attack, because this tactic works, but it does need several dogs. A lone dog would be torn to pieces by a big pack of wolves. Even with the six in the film, there were several shepherds there too, watching all night.
I don't think there is an easy answer to predators of farm animals.