Negative energy damage results from the negation of life force (positive energy) via its antithesis, and is commonly accompanied by level drain or ability drain. As this form of energy directly extinguishes life force, it is often ineffective against targets without life force, i.e. undead.
While undead are thought to be immune to negative energy since it is this energy that maintains their unnatural existence, they are only immune when the relevant script includes a race check. Spells generally have this check, so will heal undead instead of applying negative damage. Similarly for traps (starting in patch 1.69). Weapons do not have scripts, so a negative energy damage bonus will damage undead. Other sources of negative energy damage may vary as to whether or not they include a race check.
Negative energy damage resistance or immunity will reduce or the amount of damage taken from this damage type. The spell negative energy protection is a generally available (not module-specific) source of such immunity.