pronouns and their antecedents

Take the sentence, “The veterinarian took pride in her work.” The pronoun
her refers back to veterinarian, the subject of the sentence. In this context, veterinarian
is the pronoun” antecedent, the word that the pronoun refers back
to in the sentence. Usually, the antecedent comes before the pronoun in the
sentence. In all cases, the pronoun and its antecedent must agree in number
and gender.

In the following sentences, the antecedent is italicized, and the pronoun
is underlined.
The flag has lost its colors over these two years. (singular antecedent
and pronoun)
Our teachers surely know their subjects well. (plural antecedent
and pronoun)
Dogs know their capabilities. (plural antecedent and pronoun)