I'll mention the obvious thing, although I may be wrong - being in the company of someone keeps you 'in the moment', as soon as you are alone you no longer are and you identify more with your 'mind', which runs all sorts of anxiety patterns.
Another reason, which has partly the same root cause is that you have internal conflicts that start battling with each other as soon as they have time, i.e when you are alone. Here's a quote by Ralph Waldo Emerson: "These are the voices which we hear in solitude, but they grow faint and inaudible as we enter into the world". If that's the case, bringing 'attention' to the conflict and observing it, without actually taking part of it (being the watcher and not identifying yourself with the thought process) is enough for the internal resolution of the conflict to start. I personally know some people that constantly go out and hang out with random people and are unable to spend 1 minute alone. They don't have any anxiety issues, but they probably are hiding from an internal conflict.
Or you really are afraid of passing out/etc. without even realizing it, if the anxiety is more pronounced when your cell phone is dead/you are farther away from your home that's probably it.
Do you feel better the more of a social situation you are in? If so, I'd probably prefer that to social anxiety.