A three-way bulb has two filaments in it. The next time one burns out carefully open it
(for example, wrap it in a towel and hit it lightly with a hammer) and you will see the two separate filaments.
For the lowest setting, one filament comes on (it might be a 50 watt filament). For the next setting,
the second filament comes on (it might be a 100 watt filament). For the thrid setting both come on,
for a total of 150 watts. Look also at then end of the bulb's base and you will be able
to see how the lamp controls the two filaments.