Shame is the feeling that one is not enough, or not legitimate. Commonly, shame stems from early rejection, neglect, or growing up in a manner outside community standards. The discussion of dealing with one's own shame is here. This page describes how shame has become a socializing tactic.
The basic shaming transaction is to constantly measure children against ideal yardsticks that must necessarily find them lacking. The intended effect (at the best of times) is to promote development. That may occur in part, but the greatest effect is to keep children from feeling at ease and satisfied with themselves. This effect is often sought out on purpose to keep them pliable and eager to please parents and others.
Another common source of shame is expecting of children what they are not developmentally ready for. Early toilet training of course is the main culprit. Another is expecting children to show adult like self-control in kindergarten or younger 'for enrichment. Children may manage to do with difficulty things that a year or so later they could do with ease. They may be praised for this small precociousness, but the feeling of difficulty usually remains for the rest of their lives (because of neuro-muscular habit) and a feeling of shame always accompanies the action, or similar action. Shame affects the body, undermining a sense of self in the belly. A hurried child is a shamed child.
The after childhood, shame gets evoked during any mistreatment, or rough personal interaction. But shame also arises when anything is difficult. Very capable people with shame may avoid competing or learning anything really new, while compensating by learning an excess of the familiar, or doing an excess of what they do well. A sign of shame is not having a sense of enough. With shame, people are always looking for outside indications of what is enough, but not trusting those indications when they do find them. The effect is either getting discouraged and giving up, or always erring on the side of too much. Shame may be behind a lot of achievement but 1) the person is unable to get any satisfaction from it, and 2) it is a type of achievement that lacks originality and the person's imprint.
Shame is painful, and often leads to automatic patterns of reaction to ward off incipient shame. One is the ashamed manner, often with tail tucked under. The flip side of that is shameless behavior-- belligerence, violence, vandalism, drunkenness, exploiting others, etc. Both ashamed and shameless actions actually perpetuate the shame because they ensure ongoing rejection. Rejection is the engine of shame. The antidote to shame is finding and allowing unconditional acceptance that has nothing to do with performance.