Present perfect is used to describe finished actions which happened in an unfinished time. If plus a past tense is actually used to describe a kind of unreal future. So if I studied hard, I would pass the exam, but I'm not going to study hard because I don't want to. The third conditional talks about the past. And there we use had plus a past participle in the if clause. It's like a definite future with its definite future consequence.