The more unfamiliar a situation is, the more likely shyness occurs. If such a situation is avoided than it will remain unfamiliar. However, the experience of being uncomfortable or inept in a given situation may cause one to become more shy as one becomes more familiar with that situation. Since shyness can cause discomfort and ineptitude, it may become self-reinforcing.
Shyness is closely associated with anxiety. Its cause can be a kind of "chicken-and-egg" problem in that sometimes shyness seems to originate with a physical anxiety reaction, while other times it seems to develop first and then it becomes the cause of the physical symptoms of anxiety.
Especially children are sometimes shy towards strangers. This varies greatly with the child, and can also quickly disappear when the child starts feeling at ease.
Somebody may be just shy in some regard. For example, a heterosexual may be shy towards somebody of the opposite sex. Or a performer who is not shy at all on stage may be shy in an interview or in his or her personal life.
While shyness is somewhat of a drawback, the opposite, boldness, can go to far also, e.g. impertinently asking favors or causing other inconvenience. Feigned boldness as a compensation for shyness can have the same problem.
See also Love-shyness