why is had had used
Had had is the past perfect form of have and is generally used to describe experiences and actions. The past perfect form 'had had' is hence used when one talk about the past and in that want to refer to an earlier past time.
Eg: She told him off before he had had a chance to even explain the incident.
Eg: She told him off before he had had a chance to even explain the incident.