I'm not sure about that, but if you are a nation that gets good longdead and soulless, they will appear. Monkey nations get power Bandar and superweak markata, giant races get giants, atlantis gets poison coral weapon troops, and Caelums get winged undead that I have yet to see a use for.
The national undead aren't linked to resources, except possibly Markata/Atavi/Bandar for the monkey nations. It used to be about 50% of Jotunheim's soulless were giant-sized. Not sure how it works like these days.
The soulless sword guys and spear guys only appear when the dead people had equipment. If the corpses came from population, you get less or no equipment. There are also minor differences in armor so there are actually multiple spear and sword types IIRC.