It should first be noted that the first inelastic mechanism of these polymers is the mobility of the chains and the conformational rearrangement of the groups. Then the effect on semi-crystalline and amorphous polymers must be distinguished. In both cases, anchor points must be created that act as "triggers" for the effect. In the case of amorphous polymers, these will be the knots or "tangles" of the chains, and in the case of semi-crystalline polymers, the crystals themselves will form these anchor points.
By modifying the shape of the material under minimal critical stress, the chains slide and a metastable structure is created, which increases the organization and order of the chains (lower entropy), when the deformation load is eliminated, the anchor points provide a storage mechanism for macroscopic stresses in the form of small localized stresses and decreasing entropy.
In the glassy state the rotational motions of the molecules are frozen and impeded, as the temperature increases and the glassy state is reached, these motions thaw and rotations and relaxations occur, the molecules take the form that is entropically most favorable to them, the one with the lowest energy. These movements are called relaxation process and the formation of "random strings" to eliminate stresses is called shape-memory loss.
A polymer will exhibit the shape-memory effect if it is susceptible to being stabilized in a given state of deformation, preventing the molecules from slipping and regaining their higher entropy (lower energy) form. This can be achieved almost entirely by creating crosslinking or vulcanization, these new bonds act as anchors and prevent the relaxation of the chains, the anchor points can be physical or chemical.