Mary is the antecedent of the sentence. The antecedent of a sentence is basically the subject. This is the noun that a pronoun replaces in a sentence, or in a following sentence. The pronouns (words like “he”, “she”, “it”, “me”, “we”, etc.) are words we use in English (and in other languages) to avoid unnecessary and painful repetition of a name. Have you ever read a book that repeated a character’s name every two or three sentences? Gets a little annoying to read, doesn’t it? That’s why we use pronouns.
Finding the antecedent of a sentence is rather easy. You find the pronoun, and then you work backwards to find the word that makes the most sense for that pronoun to replace.