Barking is the one of the noises most commonly produced by dogs.
Although dogs are a subspecies of the wolf, Canis lupus, their barking constitutes a significant difference from their parent species. Although wolves do bark, they do so only in specific situations. According to Coppinger and Feinstein, dogs bark in long, rhythmic stanzas but adult wolf barks tend to be brief and isolated. Dogs, by contrast, bark frequently and in many different situations.
It has been suggested that the reason for the difference lies in the dog's domestication by humans. Dogs present a striking example of neoteny, the retention of juvenile characteristics in the adults. They are similar to young wolves in many of their mannerisms and physical features, such as large heads, flat faces, large eyes, submissiveness and vocalizing - all of which are exhibited in wolf puppies.
It is thought that these characteristics were deliberately selected for by early humans. There may have been a number of reasons for this. For instance, an overgrown puppy would very likely have been seen as a more engaging companion than a more mature but less amusing pet. More prosaically, an increased tendency to bark could have been useful to humans to provide an early warning system. Dogs may have been used to alert their owners that another unfamiliar band of humans or a predatory animal was in the area.
Individual dogs bark for a variety of reasons - although despite what frustrated humans might think, spite does not appear to be one of them. They may bark to attract attention, to communicate a message, or out of excitement. Dog barks do not constitute an information-rich message in the same fashion as human speech, but they do nonetheless constitute more than mere noise. Statistical analysis has revealed that barks can be divided into different subtypes based on context and that individual dogs can be identified by their barks. Disturbance barks tend to be harsh, low frequency, and unmodulated, whereas isolation and play barks tend to be tonal, higher frequency, and modulated. Barks are often accompanied by body movements as part of a broader package of dog communication.
I hope if dogs ever take over the world, and they chose a king, they don't just go by size, because I bet there are some Chihuahuas with some good ideas.
Paper and canvas prints of "Growing Up Chinese Shar-Pei" by Barbara Keith are available online.