There's a lot of stuff out there about vocalizations and what they do and don't mean from dogs. Before talking about what barking IS, I want to be sure to talk about what barking IS NOT.
Barking is not abnormal for a dog. Most problem barking has very little to do with dominance. Dogs are genetically predisposed to bark and have been rewarded for over 14000 years for barking. Dogs are not wolves and do tend to use more vocalizations including barking, whining, howling, and growling.
Barking is first and foremost a way to communicate. It only becomes a problem when it goes against what we think of as polite and civilized dog behavior. Dogs use different barks, in succession or singularly, to express different messages. Higher pitched, rapid barks usually signal excitement. Lower barks usually signal unease and uncertainty.
Dogs are social creatures, some more than others. For a dog cooped up in a yard or house without mental stimulus and opportunities to burn off energy, barking can become a response to being bored. A bark can be a lonely, "Does anybody hear me?" or an expectant "Come play!" or basically something akin to talking to hear themselves talk. Dogs dealing with separation anxiety, aggression issues, or dogs that startle easily are also prone to stress barking.
Certain breeds are more prone to barking. )Ask anyone who has ever had a terrier like Gus. Oy, the yapping.... ) Some breeds were chosen for their vermin chasing skills, some even being selectively bred so their barks could be heard underground. Left without proper outlets for their excitable energy, many of these breeds become serial yappers.
For some dogs, improper correction and timing of reward (or punishment) can leave dogs thinking they are doing a valuable thing. This can be something they've learned from you or something they think they've figured out themselves. Dogs are very bad at cause and effect. Take a dog barking at the lady who is walking past your house, for example. Dog barks. Lady walks away. Bark = stranger leaves. Never mind she was already headed in that direction, the dog thinks he's caused the threat to his house and people to abandon her mission.
If barking is a problem for you and your dog, remember that it is a communication. Your dog is trying to communicate something to you and it is your job as his friend to try to listen to what he's saying.