Recent research has revealed that agoraphobia is often secondary to panic disorder (the state of having frequent panic attacks), not vice versa as these otherwise accurate writeups state (citations for this and other assertions follow). Although they have a variety of causes and predisposing factors, panic attacks are generally caused by catastrophic misinterpretation of bodily sensations that are inherently benign. Much research has demonstrated that subjects with panic disorder are more likely to interpret ordinary, transient feelings of dizziness or faintness as signs of a heart attack, stroke, or nervous breakdown (among other things). This leads to heightened arousal, which in turn intensifies their sensations, and the spiral continues upwards until they have a panic attack.

The effect of this is that these people become extremely fearful of future attacks, and worry that if they are away from home and safety they will suffer an attack and something horrible will happen. This hypervigilance, of course, just increases their chances of having one. In this manner, panic disorder actually leads to agoraphobia. Similarly, treatment for panic disorder (involving education about the mechanisms above and gradual exposure to sensations like racing heart and hyperventilation, along with relaxation training) can lead to substantial improvement in agoraphobia as the subject's confidence in their basic safety and coping skills increases.

For basic information on the PD-agoraphobia link, see http://text.nlm.nih.gov/nih/cdc/www/85txt.html.
For information on panic disorder and catastrophic predictions, see Salkovskis, P., Clark, D., & Gelder, M. (1996). Cognitive-behaviour links in the persistence of panic. Behaviour Research and Therapy, 34, 453-458.
For an interpretation of agoraphobia dealing with distance from safety cues, see Rachman, S. (1984). Agoraphobia -- A safety-signal perspective. Behavioural Research and Therapy, 22, 59-70.