An inductor stores energy in a magnetic field when current flows through it and resists changes in the current.