What do you think caused your agoraphobia?

Mine stems from anxiety and panic attacks but I know there are other factors.

I get anxious and panic attacks at home but I am terrified of having them in public. I hate feeling like im "trapped". Being in public places makes me feel like I can't escape.