Le fait où lui fait?

Reading French comics to practice comprehension/grammar, and one thing that stuck out to me was the use of "lui" in the sentence, «il aura probablement reçu un choc violent qui lui aura fait perdre la memoire.» COD and COI are tough for me, but I always thought that for direct verbs (i.e. le chat mange la souris --> le chat la mange) that's COD, where as COI (lui, elle, etc.) answers to stuff like 'à qui' or 'à quoi.' Even when I translate something like, "the movie makes him cry" it becomes «le film le fait pleurer,» but if I do something like "the movie makes him hate the book" it becomes «le film lui fait détester le livre.» Can someone explain this? Why is it lui in some spots here when it feels like it should be le?