The present perfect tense says that an action was completed at a time before the present, and the results or consequences of the action are relevant now.
The past perfect tense says that an action was completed at a time before another action happened in the past.
The present perfect tense says that an action was completed at a time before the present, and the results or consequences of the action are relevant now.
The past perfect tense says that an action was completed at a time before another action happened in the past.