In the first step the polymers are processed by means of common techniques, such as injection or extrusion, thermoforming, at a temperature (T) at which the polymer melts, obtaining a final shape which is called "permanent" shape.
The next step is called system programming and involves heating the sample to a transition temperature (T). At that temperature the polymer is deformed, reaching a shape called "temporary". Immediately afterwards the temperature of the sample is lowered.
The final step of the effect involves the recovery of the permanent shape. The sample is heated to the transition temperature (T) and within a short time the recovery of the permanent shape is observed.
This effect is not a natural property of the polymer, but results from proper programming of the system with the appropriate chemistry.
For a polymer to exhibit this effect, it must have two components at the molecular level: bonds (chemical or physical) to determine the permanent shape and "trigger" segments with a T to fix the temporary shape.