Different languages use different mechanisms to convey meaning and tie parts of sentences to other parts.
I learnt recently that ancient Greek (and perhaps modern Greek, but I haven't looked into it) used a slew of prefixes and suffixes to modify verbs and nouns, so that a single word carried a lot of information. Word order didn't matter so much because of this.
For example, consider the English sentence "X fought Y". In ancient Greek, you would 'decline' (modify) the nouns X and Y to what amounted to "the subject X of the verb" and "the direct object Y of the verb". So where "X fought Y" and "Y fought X" are different sentences in English, with "X Y fought" and "fought Y X" downright nonsensical, just about any word order would be fine in ancient Greek because you always knew who did the fighting and who the fighting was done to.
The cost of all this richness in the language is that words need to be inflected differently when used in different parts of a sentence. English is a lot less complicated by this measure, but the cost to the simplicity is that word order becomes extremely important. Where word order alone doesn't solve the problem, you may need to pick different words to bring out the intended meaning.
Now, pronouns are typically tied to their actual nouns by context, if not explicitly. But in your examples, the ties are weak to the point of (real or forced) ambiguity. Normally, pronouns refer to the closest relevant noun, but this isn't always the case. Separating them with punctuation weakens this rule of thumb even more.
- Mary and Jane entered the room. She lit the candle for her. (completely ambiguous)
- Harry and Jane entered the room. He lit the candle for her. (completely unambiguous)
- Mary entered the room. Jane lit the candle for her. (unambiguous by context)
You ask how to get rid of pronoun ambiguity, giving the following sentence as an example:
When Anne’s grandmother died she lit an extra candle for her on her birthday.
The common problem to all the alternatives you suggest is that replacing one ambiguous pronoun with another ambiguous pronoun doesn't resolve the ambiguity. Even deictic terms like that (or more politely, that person) don't work because there is no finger pointing to the thing that that is referencing.
The natural reading of your original example is that Anne did the candle-lighting for her grandmother. It is unclear whose birthday it was, but that information could come from Anne's (sub)culture. If their community lit candles for the dead on the birthdays of the dead, for example, the sentence would likely reference the grandmother's birthday. In a different subculture, one would read the 'extra' candle as being for the grandmother, so the birthday was Anne's.
With less context available, the standard way to remove ambiguity in English is to reword the sentence. For example:
- On Anne's birthday, she lit an extra candle to mourn the death of her grandmother.
Here, all the pronouns naturally point to Anne.