Is there a way to stop a dead person from coming back as a 'spontaneously created' undead like a mohrg or spectre? The write-ups in Bestiary 2 make it sound like those undead can form without the intervention of a necromancer, but are there any other requirements/limitations? For example, does a proper burial ceremony stop this happening, or is it basically something that you can't ever prevent 100%?
Some context from my game: I'm running Kingmaker, and my players have recently killed the Stag Lord. He sounds like the perfect candidate for becoming a spectre or mohrg, but the PCs gave him a proper burial ceremony.
It's left pretty vague so that writers can have more freedom for storytelling. There are methods you can use to prevent it. Gentle repose will prevent it but the spell'd need to be recast on the body each day. In 1st edition, there was a spell called hallow that prevented it as well, but we haven't updated that one to 2nd edition yet.
The right solution for your game is to let the PCs do the proper ceremony, and then respect their work by not having him come back as an undead later. You as the GM are the one that gets to make the decisions when a creature becomes undead, after all, so by just not running a plot where the Stag Lord comes back from the dead as an undead, that's all you need to do.
If you DO intend to do this plot, you should foreshadow it somehow so that it doesn't look like you're just arbitrarily undoing the PCs' work.
And if you've done this plot many times before in your games, you've already trained your PCs to expect such a plot. In this case, I'd suggest NOT having the Stag Lord come back, telling the PCs that "By performing this ritual you are consecrating the body and hastening its trip to the Boneyard" or something like that. And then give them a bit of extra XP as "proof" that they prevented a future undead Stag Lord. And then honor that by never having him come back as undead.
Thanks for the insight in how this works in universe. The last thing I want to do is to make the players feel like I've cheated them, which is mostly why I was asking. In some settings I've run games with, you can't stop things like this happening; if that'd been the case for Golarion my first step would have been to let the players know, so they could properly plan.