"He writes her a book."
Because he's writing a book FOR her. It's an indirect object pronoun, used in situations like "To whom?" or "To what?".
La is a direct object pronoun used for "her" or "it" (or the formal "you", but don't worry about that for now). Le is an indirect object pronoun used when you're doing something "to something" or "for something". It's one of those things where you can't directly translate the sentence.
If you're still not getting it, I found this to be a big help.