At a 1963 laboratory management meeting at the U.S. Naval Ordnance Laboratory, a sample of a nickel-titanium alloy was presented that had been bent many times out of its original shape. To see its response to heat, associate technical director David S. Muzzey held the sample over his pipe lighter. To everyone’s surprise, it returned to its original shape.
The “shape memory effect” occurs because of the structures involved — when stresses deform the material, its atoms retain their relative position; no bonds are broken or reformed. So when heat is applied it can “remember” its original shape, which it retains after cooling.