Many words change in the dative case. For the third person pronouns, the following are different from the nominative case: the masculine pronoun is “ihm” (to him), the feminine is “ihr” (to her), the neuter is “ihm” (to it), and the plural is “ihnen” (to them).
This explains why when thanking a female person it is only correct to say “Ich danke ihr” (I thank her) and not “Ich danke sie” (I thank she).
Demonstrative Pronouns in the Dative Case
All four instances of demonstrative pronouns (the three genders and the plural) change in the dative case. For the masculine, the pronoun is “dem” (to/with that), for the feminine it is “der” (to/with that) and for the neuter it is “dem” (to/with that); for the plural it is “denen” (to/with them).