Why dogs develop fear-related conditions in the first place is a complex question without an easy answer. Genetics play a role (experiments have shown you can breed for fear of people, for example), and so does proper socialization, the all-important early exposure to new people, places, animals, sounds, and objects. Puppies who have positive experiences with all-things-new are much less likely to develop fear later in life. But that isn’t the whole picture, because some well-socialized dogs do develop fear disorders. And again, bad experiences (abuse, accidents) can explain some of those cases, but not all.
Helping a fearful dog takes patience and effort on the part of human companions. Once a visit to a veterinarian has excluded pain or illness as the source of a problematic behavior, a qualified trainer or behaviorist can assess the situation and design a behavior modification plan. Treatment might include desensitization (exposing the dog to something he fears at such a low level it doesn’t trigger his anxiety) and classical counterconditioning (pairing something the dog fears with something he loves). The less-than-good news is the amount of time it can take to see improvement. But the good news is that dogs can and do overcome fear. Not all dogs, but most.