a gerund is a verb that ends with –ing and also functions as a noun. It is a word that is formed with verbs but act as nouns. It acts as subject or object of a verb, or can sometimes take a plural ending. gerund can look exactly the same as a present participle of a word, but describes something else. Hiking is a great form of exercise. In this sentence, hiking is the gerund because it acts like a noun.
In the battle against the dragon, Wiglaf displayed courage and loyalty - which are the most valued virtues in Beowulf. With Wiglaf's help, Beowulf is able to defeat the dragon and presenst him with his golden necklace as a symbol of transfered power from a king to his chosen successor.