There’s an interesting dichotomy I’ve noticed when it comes to creating the undead in most games. If you’re inflicting that condition on someone else, it’s virtually always a deliberate act, typically via spells such as animate dead or create undead (often with extra effort required on the part of the spellcaster to create more powerful undead). Likewise, most undead that have the ability to make more of their kind aren’t typically doing it unintentionally (unless they’re so far removed from rationality that they’re unaware of what they’re doing, making them a sort of social virus).
But when undeath is self-inflicted, it’s almost always unintentional; from ghosts coming about because someone couldn’t rest easily to revenants who come back from the grave to take revenge on their killers, these aren’t circumstances where someone deliberately decided “I think I’ll turn into an unliving monster” and made steps to that effect. It’s just that they were so distraught that they happened to come back from the grave.
Now, obviously, exceptions exist. Liches, for instance, are a form of self-inflicted undeath which require a great deal of preparation on the spellcaster’s part.
But insofar as the intent/target dichotomy goes, we’ve still covered only three of the four combinations. Spells used on corpses are deliberate/other, people who find themselves unable to rest easy are accidental/self, and even the lich (and similar undead) are deliberate/self. But notwithstanding the aforementioned undead who have the “create spawn” power and are completely insane, the fourth option – accidental/other – isn’t really present.
So what would it look like if it was?
My guess would be that spells which use negative energy as attack vectors, such as the various inflict wounds spells, chill touch, harm, etc. – as well as spells with the [death] descriptor, such as slay living, circle of death, and similar magicks – would have a chance of causing those slain by them to rise as undead creatures, regardless of the caster’s intent.
Exactly how the mechanics of this would work is something I haven’t worked out yet, mostly because the specifics will inform a lot about how these spells are used in a campaign setting. Do these spells have to deliver the killing blow, or is it enough that they inflicted hit point damage in the rounds before something else killed the victim? Since these spells only have a chance of reanimating someone, how is that chance measured (personally, I like a percentage equal to the caster’s level, but that’s just off the top of my head)? What type of undead does the victim come back as?
Similarly, in any setting that uses this idea, there should be relatively accessible options for defeating this chance also. This evokes the idea that clerics, paladins, and other servants of good deities would have funerary methods that negated these chances. But again, the issue is determining exactly how this is done. While there needs to be some sort of control mechanism (otherwise the entire issue with having accidental undead can be avoided so long as there’s a priest character on hand), what that mechanism is changes how the setting deals with this.
Is a single application of positive energy enough to negate the chance (making Pathfinder’s “burst channel” very useful in that regard) of someone rising as an unquiet dead? Or does a person slain by negative energy need to be buried in a hallowed area? Or can a good-aligned priest sanctify one corpse per day per rank in Knowledge (religion)? Each option (or a different one) will change the campaign’s presentation around this issue.
It’s an interesting premise however you slice it, and hopefully the “accidental undead” give you some ideas for your next campaign.