This is an example of a stranger anxiety, which is common in younger children. They are not familiarized with many people and thus get anxiety upon encounter. But with time, this anxiety is reduced and children become more normal towards the people they do not know.