Here's why:
* Joy is a feminine name, so the objective pronoun is her.
* Mark is a masculine name, so the objective pronoun is him.
Objective pronouns are used when the pronoun is the object of a verb or preposition.
For example:
* "I gave her a gift." (Her is the object of the verb "gave").
* "The teacher spoke to him about his homework." (Him is the object of the preposition "to").