I would argue they do offer some protection, but it is not as good as an occluding style of hearing protection. By design, active noise cancellation only works on repetitive sounds. The ear pc has to make anti noise to cancel out the noise and to do this they sample the noise then make the same noise 180 deg out. So they do not offer any protection to impulse noise, ie gunfire. Also why it takes a second or two for it to start working. Why it works for things like engine noise on an airplane, but does nothing for the baby crying next to you.This is the answer.
Noise cancelling headphones or earbuds DO NOT protect your hearing. Stop using them when you need hearing protection.
The other downfall of active noise cancellation is the frequency response. If you can get ahold of the actual response of the device, it will probably show that it only works well for low frequency sound.
There is some debate if active noise can cause hearing damage for loud sounds as the ear may still be exposed to high pressure levels as it takes a equal pressure to cancel a similar level wave and if they are not exactly 180 out you get hit by the pressure from the speaker.