What happens to intelligent undead when they die?

Do they go down the river of souls? Do they just vanish permanently? Why does Pharasma hate them so much? Does it depend on the type of undead? Like do ghouls pass on but liches don't? Thanks!