Shyness is an effect, not a cause.) And it is an effect of many different causes. It could be inability to cope with other people due to some deficits, as in a mild form of autism know as Asperger syndrome, or it could be a result of a childhood traumas, or, which is usually the case, some genetic predisposition
and environmental causes
and social deficits
and some kind of feedback loops leading to a repetitive behavior.
Asperger's is a learned behavior, which could be unlearned and retrained by a set of CBTs, while severe forms of autism, which are caused by some neurological deficits in much greater extent that just environmental feedback, cannot be altered by mere CBT.