While they've been selectively bred over centuries to have specific traits, German Shepherds are descended from wolves. They share a common ancestor with wolves, and their DNA is very similar. In fact, German Shepherds are one of the dog breeds that are most closely related to wolves.
This explains why German Shepherds often exhibit some wolf-like behaviors, such as howling and having a strong pack instinct.