Previous experience with 〜た+ことがある
Past experience is conveyed by appending ことがある to the past-tense form of a verb. こと turns the phrase before it into a noun.
Alternate explanations
Someone has done something. Someone has had an experience doing something. There was a time when ~.
In general, Sinf-past ことがある expresses the idea that there was a time when someone or something was in a state or did something.
More specifically, Sinf-past ことがある expresses one’s experience. In this case, Sinf-past ことがある is an extended use of the possession expression “Aは Bが ある”, where B is a past action rather than a possessed thing. This extended use of the possession expression of experience in Japanese is parallel to that in English. Possession: “I have a car.” Experience: “I have [studied Russian.] (past action)”
Makino, Seiichi and Michio Tsutsui. “Main Entries.” A Dictionary of Basic Japanese Grammar, The Japan Times Ltd., 1989, pp. 196–197
The た form of a verb, followed by ことがある, expresses experience: someone has had the experience of doing something or being somewhere.
To express a lack of experience doing something or being somewhere, こと が/は ない is used in place of こと が ある.
Kamiya, Taeko. “Expressing Ability, Preference, Desire, Intention, Resolution, and Experience.” Japanese Sentence Patterns for Effective Communication, Kodansha, 2005, p. 204
Stating Previous Experience (Vた ことがあります)
Nは Vた ことがあります
N has had the experience of doing V.
This pattern is used to indicate that one has had the experience of doing something, and that something is expressed by a verb in the plain-form past tense before ことがあります (“to have the experience”).
Chino, Naoko. “Basic Pattern 38.” A Dictionary of Basic Japanese Sentence Patterns, Kodansha, 2000, p. 228