Many students use these two “third person” pronouns interchangeably. While writing a sentence, it is important to understand that:
THEY = A subject pronoun.
That is, ‘THEY’ takes the place of a subject in a sentence.
THEM = An object pronoun
That is, THEM takes the place of an object in a sentence.
Let us read a sentence about ‘companies’:
I have found that most of them are hiding their actual accounts and they are lying to the public.
Here is the sentence’s break-up:
I (subject) have found that (conjunction – connects two clauses) they (subject of clause) are hiding their actual accounts and are lying to the public.
I (subject) think that (conjunction) they (subject of clause) are lying.
Most countries (subject) consider them (object) as adults since they (subject of clause) live independently.
The Indian army (subject) defended the border even as the Britishers attacked them (object) with full might.