I've jotted down my understanding of the 'perfect tenses' here. Bear in mind that this is only my understanding of them, based on a perhaps rather old-fashioned education too many years ago to bear thinking about... and may be incomplete or flawed! Anyway, here goes...
Present perfect is used in three basic cases, all involving activities in the past (rather counter-intuitively):
1/ When describing events in the past of non-specific time.
She has visited this place before.
He has written a book.
They have been close.
2/ When depicting an action or an event that started in the past and is still happening now.
She has eaten at this same restaurant for years.
He has walked a long road to get to this point.
We have lived in France for forty years.
3/ When describing an action that started in the past but finished recently (there's often an unstated, implicit 'now' at the end of the sentence).
The oracle has spoken. We move on.
They have forgotten. History has become myth to them.
He has made the decision.
Present perfect is generally not used to describe an action or event at a specific time:
She has eaten there last Wednesday (!)
That needs the 'past perfect'.
She had eaten there last Wednesday.
The past perfect usually conveys the sense of an action or events in the past that finished before another action started (although the 'second event' can sometimes be unspoken or even 'doing nothing', as in the example above).
She had spoken to him on the phone and he had allayed her suspicions.
He had visited the shop and returned with bread and cheese.
The past events can be over a long duration, but must be completed.
They had lived there for years before moving to France.
There's also the 'present perfect continuous' (don't you love the simplicity of English!) which is the 'has/have been' formulation; this specifically implies the sense of 'still doing stuff now'.
We have been talking on the phone.
She has been training to be an astronaut for years.
He has been anxious.
Of course, there's also the less common and to my ear sometimes clumsy 'future perfect' (will be / will have been). This describes either actions that will be finished at some point:
When she sings, they will have completed the programme of events.
or actions that occur in the future and will continue beyond a certain point in the future
In August, I will have been writing my novel for thirty-five years. 😄
Phew! Hope this helps. Actually, reviewing these 'rules', I've realised that the sentence from your book that I used: 'It had been many years now since she’d found this particular subconscious manifestation of her selfloathing despicably self-righteous and annoying...' could be seen as borderline as it's formulated, depending on whether you view her loathing as a specific 'timed' event. But although Malis's feelings of self-righteousness have finished (it's been many years since she's felt them) the time at which she felt them, and the duration of those feelings, are left indeterminate, and she's still living with their echo, so on balance I think I'm right in feeling that the 'past perfect is the better option and 'has' reads slightly more naturally!
Glad the notes were helpful. I really enjoyed the passage, and I'd love to read more in due course if you felt you wanted to share further extracts!