The confusion arises From the fact that in both of these cases the first appearance of a form of "to have" is used as helping verb and the second one relates to actually having something.
"have had" is the present perfect. This means that something was "perfect" (completed) before now.
"had had. is the past perfect. This means that something was completed at some earlier time.
Let's use something else for the second verb in a present perfect and past perfect example.
"I have done that." Whatever "that" is was done before now.
"I had done the chore before Mom asked me to take out the trash." The chore had been completed before the time of this statement.
Note that both the present and past perfect require the participle of the action verb. That is "done" for "to do", and "had" for "to have".
Hence we get: "have had" and 'had had".
Hope this helps.