Personal pronouns change depending on the case they are in. You will learn how to distinguish between different cases, but for now it is enough to say that "sie" is the subject and "ihn" is the object of the sentence. Subjects are in the Nominativ case, while objects are in Akkusativ. "Ihn" is the Akkusativ form of "er".
Because of the way the verb is conjugated. Since it says "Sie mag" it means "she likes." If Sie was being used to mean they, then the verb would be conjugated as mögen. If you hover over a verb it will often give you the choice at the bottom to show the rest of the conjugations for the verb. The conjugation is how you differentiate between what word is being used, or meant.
P.S. I use the little conjugate button which I mentioned and I have a separate notebook just for verbs where I write down all of these conjugations for each verb I learn. This helps me remember them so that I do not run into the problem that you have run into, which is being confused about the translation
Regular verbs (which in this example is not) typically have a -t conjugation for a "she" subject. They also have a -en conjugation for "they" OR "(formal) you".
Mögen is not a regular verb, so:
ich mag du magst sie/er/es mag Sie mögen -- wir mögen ihr mögt sie mögen
No, because it's accusative. "Sie mag ihn"- wen(whom) mag sie?Ihn. When it's accusative it's IHN, when it's dative it's IHM. You gotta always put the question. Accusative question: "wen?" or "was>" (whom or what); Dative questions: "wem?" Exemple for IHM: Ich gebe ihm das buch (i give him the book)- question: "Wem?" or "Wem gebe ich das buch?"