Why avoidant personality disorder is developed is unknown, but it’s most likely a combination of genetic, psychological and also social factors. Everyone with avoidant personality disorder were shy as children, this doesn’t mean that every shy child will develop a disorder though.
Children starts getting self-aware already when they’re a few days old and self-conscious at very early age. At around age three-four it’s normal that a child starts having self-conscious emotions like guilt, embarassment, pride and other emotions. They start being aware when they for example draw attention, if they’re dressed differently than other children and in general start comparing themselves with others.
How self-conscious someone is is individual, some are more than others. People with avoidant personality disorders were very highly self-conscious early as children. There’s more unpleasant feelings of self-consciousness than what is normal like exteme shyness, shame and embarassment from really small things like writing a letter backwards, saying something incorrect at school or do a curtsey a little wrong first thime when you’re only four years old. Some examples from my own childhood. There’s also lots of feelings of never living up to expectations.
Since there’s a lot of emotions of shame, mistrust and feeling inferior to others the avoidant child won’t talk about their feelings and fears. For this reason it can be very hard for parents or other adults to notice and understand that the child is self-conscious to an unhealthy level and prevent a personality disorder from developing.