I believe the difference is the tense.
" I have done it" is present perfect tense.
"I had done it" is past perfect tense.
Why? Perfect tense always uses the verb in its past form, i.e. done instead of do or doing.
Present perfect uses the present form of the words "have" or "has" + past participle (done).
Past perfect uses the past form of have or has, which is "had" + past participle (done).
Future Perfect will therefore use "will + have" and the past participle (done).