I think this is more a question about the use of lui, but there are some examples here that use it. Ils rient avec lui, pas de lui. They laugh with him, not at him.
How do we know lui is HIM and not just him/her without any other context. Do I just take the translation for what it is, or am I missing something fundamental? I find this to be so confusing. Thank you.