Inside are two metal strips. One strip gets magnetized and demagnetized, and the other is magnetostrictive — meaning it changes length ever so slightly in the presence of a magnetic field.