A gerund is a form of a verb used as a noun, whereas a participle is a form of verb used as an adjective or as a verb in conjunction with an auxiliary verb.
If we wish to emphasize that one action was before another then we can use a perfect participle.