I've always hated the use of the term "resistance" when describing impedance, yet it's hard not to use it. Perhaps to define the difference...
Resistance is the resistance to electron current flow, and is considered constant for DC and AC signals of any frequency. Resistance is measured by applying a small DC voltage and measuring current flow.
Impedance also resists current flow, it's a little more complicated. Impedance is a composite of three electrical properties: resistance, inductive reactance, and capacitive reactance. Inductive reactance comes from a coil of wire, or something acting like a coil, and resists current flow more as frequency goes up. Capacitive reactance comes from a capacitor, or something acting like one, and resists current flow less as frequency goes up. Roll all three together and you have impedance. Impedance may not be constant with changing frequency.
Headphones and speakers have all three properties, but we only talk about the composite, impedance, because it's easier. Technically, impedance should be specified with a graph of impedance vs frequency for a complete understanding of what it means to us.
Here's an example of an impedance curve that changes a lot with frequency:
Here's an example of an impedance curve that doesn't change much with frequency:
It's not that one curve is better or worse, but it shows that a single figure impedance spec is kind of pointless.