A rooster will do his best. Some have been known to take on predators, at the cost of their own lives. Most are best at warning the hens of danger, giving the hens time to seek shelter.
Once I saw my older roo do his best to distract a dog, by running back and forth between the dog and his hens. Somehow the roo, Thor, was able to sense and/or see when the hens were safely hidden. Then and only then did he seek shelter himself.
One thing you'll notice with a good roo. When the hens are all busy foraging, with their fluffy butts in the air, heads down, it's the roo that has an eye on the sky; always keeping watch for predators.