Although I know that I can't elaborate the issues well, I would like to point out a few important grammar terms related to the constructions (A) and (B) in the OP's question. Most of the following is extracted from Practical English Usage by Michael Swan. Some is extracted from Wikipedia pages. Mistakes are mine.
Present Perfect: We use present perfect to say that a finished action or event is connected with the present in some way. If we say that something has happened, we are thinking about the past and the present at the same time. (For example, I have known her for years. You have done a lot for me.)
Passive Voice (also known as "Passives"): In a clause with passive voice, the subject denotes the recipient of the action rather than the performer. (They built this house, is in active voice. The house was built, is in passive voice.) Passive tenses are normally used in the same way as active tenses. For example, the present progressive passive is used, like the present progressive active, to talk about things that are going on at the time of speaking. (For example, The papers are being prepared now.)
Gerunds: When -ing forms are used like nouns, they are often called "gerunds". (For example, Smoking is bad for you. I hate packing suitcases.) It can sometimes be difficult to decide which term to use (between "gerunds" and "present participles"). Some grammar books might refer to verbs with -ing as "-ing forms".
Both OP's sentences (A) and (B) are in the past tense. They both have the same main verb, liked.
Consider sentence (A),
She liked being looked at.
The part "being looked" is a gerund, as godel9 explained.
Now, consider sentence (B),
She liked having been looked at.
The part "having been looked" in sentence (B) is also a gerund. It is also in a perfect tense, and in passive voice. Although this construction is possible, it's rare. The COCA corpus returned no result at all for other verbs in the place of liked, except for reported. For example,
Most patients reported having been bitten or scratched by an animal.
Less than one in four IDUs surveyed reported having been offered vaccination ...