Dogs bark to communicate with other dogs and with humans. Dogs are descendants of wolves, which are social animals that live in packs, and they share many of the behaviors that define the complex relationships that exist within such animal groups. Few domestic dogs live together in packs (though they often consider their human family their group), but they still use complicated behaviors that involve smell, sight, and hearing to communicate.
A dog has many scent-producing glands that it uses to communicate. The scent that a dog leaves behind (in its urine, feces, and paw prints) can reveal its sex, age, and even its mood to other dogs that come sniffing by. A dog uses its posture, facial expression, and ear and tail position to communicate with other dogs, too. And it uses its voice to communicate by whining, growling, howling, or barking. A dog usually whines or whimpers when it is in distress: when it is hungry, cold, or in pain. Growls indicate that a dog is angry and ready to fight. Barks usually show excitement.