People cope with insecurities in a variety of ways.
An entire multi-billion-pound drug-based industry is rooted in the need for people to find a relaxant to assist them in feeling less awkward in social situations - it's called alcohol.
Other people consciously or subconsciously. exaggerate themselves or their achievements in order to build a bigger impression on people than they feel they would achieve simply by being themselves.
So I would be inclined to agree that it is based on a coping mechanism - feeling relaxed and good about yourself is something we all enjoy - some people simply need it more than others, and compensate accordingly.