After death some might turn into undead by different means of magic. when brough back to life as an undead gaining new sheer strength and magic powers is to be expected while things like sense of hunger and pain are lost but they can still starve to death or be killed, memories are retained.
Some people are genetically set to turn automatically into undead after death, but the rest of the population can only be brought back to life by magical events only.
Since all undead retain their memories, most of them have no dangerous intents (they don't eat people), actually it's not rare to find undead who want to go back to their families.
But almost every single living person just wants to straight out eliminate all undeads from existence.
Why would people want to exterminate undeads and what do they have to gain from it?
Corpses stop decaying after being brought back to life.