The word "whom" is a pronoun that is used to refer to the object of a verb or preposition. It is often used in formal contexts and typically follows a preposition or comes after a verb when the action is done to the person being referred to.
The word "whom" comes from the Old English "hwam," which is the dative form of "who." The word has evolved over time while maintaining its function as a pronoun used for the object of a verb or preposition.