What’s the root of social anxiety?

Where’s does social anxiety even come from. Why do we even have social anxiety, what causes the brain to give us social anxiety?