Undead in NetHack are a class of unliving monsters. They include the following monster classes:
Undead take extra d4 from blessed items, and vampires and shades take an extra d20 from silver weapons. Drinking holy water also harms them; however, unholy water actually exercises their constitution. Undead deal double damage in the hour of midnight.
Reading the Book of the Dead while cursed will summon hostile undead. The blessed book will pacify them, and tame them wherever possible if you are chaotic. If nothing else helps, the Sunsword does double damage against undead.
Undead and garlic
All undead dislike garlic and will avoid it where they can.
Whether a monster is undead is determined by whether it has the monster attribute M2_UNDEAD. Currently this is completely coincident with the monster classes enumerated above.