The analogy is simple. There are three types of people in this world: sheep, wolves, and sheepdogs. The vast majority of people are sheep — nothing wrong with that. They move about their day carelessly, are loving and compassionate beasts, and only rarely, accidentally hurt each other. The wolves want to devour the sheep. They'll cause as much harm as they can with little remorse. These are the terrorists, despots, dictators, and other types of villains in this world.
Which brings us to the sheepdog, the guardian of the sheep against the wolves. Their capacity for violence is frowned on by the sheep. Their capacity for love is frowned on by the wolves. The sheepdog is bound by duty in that middle ground. They are the troops, first-responders, and anyone willing to take a stand against the evils of this world.
The quote gained much traction after the release of American Sniper, during which these different types are explained to a young Chris Kyle. While the phrase doesn't appear in his memoirs, it was used by his friends-and-family-run Twitter account. The actual source of the speech comes from Lt. Col. David Grossman's book, On Combat. In it, he credits the analogy to an old war veteran.
Many people misattribute the "sheepdog" as a badge of honor that proves they're better than sheep. Thinking a sheepdog is defined by their capacity for violence while waving a good-guy banner, however, is as counter-productive as it is flat-out wrong. Yeah, a gun-toting sheepdog might make a great t-shirt, but it goes against the rest of Grossman's book, which largely covers coping strategies for the physiological and psychological effects of violence on people who have had to end enemy lives in the line of duty.
The goal of the sheepdog is to prevent violence and keep the blissful sheep safe. The sheepdog isn't actively seeking to harm others — that's the work of a wolf. The sheepdog is defined not by his hatred of wolves, desire for violence, or any similarity that blur the line between wolf and sheepdog. They are not defined by the reasons why they're not sheep.
It's the love and compassion for those who cannot defend themselves that truly defines a sheepdog. It's what makes us different from the wolves.