I don’t believe a full answer exists, but let me patch together some pieces and speculation.
In Deathly Hallows, Harry returns the Elder Wand to Dumbledore’s grave:
“I’m putting the Elder Wand,” he told Dumbledore, who was watching him with enormous affection and admiration, “back where it came from. It can stay there. If I die a natural death like Ignotus, its power will be broken, won’t it? The previous master will never have been defeated. That’ll be the end of it.”
Dumbledore nodded. They smiled at each other.
– Deathly Hallows, chapter 36, The Flaw in the Plan
Although Harry is a teenager with no expertise in wandlore, I’m inclined to take Dumbledore’s nod as confirmation that the wand’s power really would have been “broken”.
In the context of the Elder Wand, this probably means that it would no longer be the most powerful wand in the world, and its chain of owners would be broken. Nobody after this can truly “own” or “master” the wand, because there’s a gap in the chain. It would probably revert to performing whoever is physically holding the wand, as Voldemort believes it would.
But the Elder Wand is a special case. There’s a Pottermore entry containing Ollivander’s notes on wand woods (transcript) which goes into more general detail. Wands have different behaviours upon owner death, depending on their wood and core. Some examples follow.
Let’s start with the entry for ash:
The ash wand cleaves to its one true master and ought not to be passed on or gifted from the original owner, because it will lose power and skill. This tendency is extreme if the core is of unicorn.
So a wand can certainly lose its ability if the original owner dies (which is what I guessed would happen with the Elder Wand). At the more extreme end, hazel wands may give up completely if the owner dies (whether naturally or otherwise):
It is capable of outstanding magic in the hands of the skillful, and is so devoted to its owner that it often ‘wilts’ (which is to say, it expels all its magic and refuses to perform, often necessitating the extraction of the core and its insertion into another casing, if the wand is still required) at the end of its master’s life (if the core is unicorn hair, however, there is no hope; the wand will almost certainly have ‘died’).
Notice that both ash and hazel wands with unicorn hairs perform particularly badly when the owner dies. This suggests that a combination of wood and core determine what happens when the original owner dies. (This is tied to the more general idea that wands have “personalities”.)
(Worth noting that Ron’s first wand is ash, allegedly with unicorn hair (although I can’t find the reference), and his second wand is notably better performing in Goblet of Fire.)
Another page from Pottermore on wand cores (transcript) confirms that unicorn hairs are particularly devoted to their original owner:
They are the most faithful of all wands, and usually remain strongly attached to their first owner, irrespective of whether he or she was an accomplished witch or wizard. […] they are prone to melancholy if seriously mishandled, meaning that the hair may ‘die’ and need replacing.
This also suggests an alternative Elder Wand hypothesis: because it is so strongly tied to its master, it might also wilt or die if the master died a natural death. But that’s just a guess.
Finally, we get an amusing fact about laurel wands, which might recur if the owner died:
Otherwise, it will cleave happily to its first match forever, and indeed has the unusual and engaging attribute of issuing a spontaneous lightning strike if another witch or wizard attempts to steal it.
I don’t know of any canon resource which describes the general case, but I hope these three examples give you some idea of what might happen.