It was the cat’s birthday, so the dog bought her a present.
In this standalone sentence, there are only two things that could be referred to by her: the cat and the dog.
- Both birthday and present are nouns, but neither one of them can reasonably be assigned a female gender in this context. Nor would it make any sense to believe that the dog bought the birthday a present or that the dog bought the present a present (discounting the additional problem with the syntax around present where that would result in the pronoun coming before the noun and the recursive fact that it would mean the present was the present's own present).
- It's possible that her refers to something in an unstated previous sentence—but, for the sake of argument, let's assume that we're only concerned with this single sentence and there is no context that's been omitted.
This leaves two possibilities:
It was the cat's birthday, so the dog bought (the dog) a present.
There are a couple of problems with this interpretation:
- When it's somebody's birthday, presents are generally bought for the person whose birthday it is. From the point of view of common sense, it's unlikely (although not impossible) that the dog would buy a present for anybody other than the cat.
- If it really were the dog who was the recipient of the present, a reflexive pronoun would be the far more likely choice: the dog bought herself a present.
It was the cat's birthday, so the dog bought (the cat) a present.
By the process of elimination, this is the only likely interpretation remaining. It is also positively supported by virtue of the fact that it is the cat's birthday—making the cat the likely recipient of any present.
So, there are really the only two sentences that would make sense:
1. It was the cat's birthday, but the dog bought herself a present instead. [Herself refers to the dog.]
2. It was the cat's birthday, so the dog bought her a present. [Her refers to the cat.]
Since the wording of the actual sentence is that of the second interpretation, the second interpretation is the only one that makes any real sense.
There is no explicit certainty of the referent of any pronoun. It's always possible to come up with some outlandish context for a pronoun to actually be referring to something other than what it was intended to refer to. But unless there are reasonable grounds for uncertainty, you can assume that it's referring to what it makes sense for it to be referring to.