Looking up...
Je lui ai tout raconté.
I told him (her) everything.
Third-person singular indirect-object pronoun: to him, to her.
Je lui ai tout raconté.
I told him (her) everything.
Lui as indirect object is gender-neutral; context reveals him or her.
Stressed pronoun for masculine persons: him.
C'est lui qui a gagné.
He is the one who won.
As a stressed pronoun it is usually masculine; feminine uses elle.
From Latin illi huic (to that one).
Le/la are direct (je le vois); lui is indirect (je lui parle).