What is meant by the word agreement when referring to correct pronoun usage?

A pronoun must agree with its antecedent in number and in gender:

The men (antecedent=plural) tried, but they (plural) failed.

John (antecedent=masculine) left his (masculine) car at home. 

When the number and/or gender of the antecedent is indefinite, e.g., everyone, everybody, a common option is to rewrite the sentence using plurals:

  Instead of: Rewrite as:
  Everyone took (his or her?) own files home for safekeeping. All personnel took their own files home for safekeeping.