Dogs are descended from wolves and interact with humans the same as they would with other dogs within a pack.
They are protective of their family or pack and instinctively attack only when hunting or frightened.
This behavior can be altered in some dogs through aggressive training.
Guard dogs have to learn to attack on command from the human alpha dog, their trainer.
“Sic ’em,” a very old command, is an abbreviation of “seek him.”