When memory metal is bent, it deforms. When placed into hot water, the metal "remembers" its original shape.
A metal bobby pin is heated until red hot, then allowed to cool slowly; this process is called annealing. The annealed bobby pin is very flexible.
The tempering process, which involves heating a hardened bobby pin then cooling slowly, transforms the brittle metal into springy metal.
An annealed bobby pin is heated, then cooled quickly; this process is called hardening. The hardened bobby pin is brittle.