Structurally, Beowulf is divided into three main parts, each one of which centers around Beowulf's confrontation with a particular monster: first Grendel, then Grendel's mother, then, fifty years later, the dragon. Each monster functions symbolically as a force of evil against which can be tested the moral force of the heroic code of honor explored throughout the epic, represented physically by Beowulf, the hero who most perfectly adheres to that code. The inventory of traits and behaviors that comprise the code of honor makes up a substantial portion of the thematic material of Beowulf, as situation after situation is introduced to exhibit proper and improper ways to behave. The relationship between King Hrothgar and his warriors, in which Hrothgar gives them treasure and a mead hall in return for their loyalty and bravery, represents the proper relationship between the lord (or "ring-giver") and his men (or "thanes") in the Anglo-Saxon social scheme. Beowulf himself emphasizes the importance of reputation and fame as part of the heroic code, continually boasting of his exploits--in a way that is eminently socially acceptable in his society--and describing fame as a bulwark against death. Another aspect of the code explored throughout the epic is the propriety of revenge: when an ally is killed, it is more honorable to avenge his death than to mourn it. This is shown by Beowulf's attack on Grendel's mother following her murder of Aeschere.
The first part of the book, in which Beowulf fights and defeats Grendel, is most preoccupied with the idea of reputation and fame, as Beowulf boasts of his past deeds and looks forward to his heroic showdown with Grendel; the second part is most preoccupied with the idea of revenge, as Beowulf helps Hrothgar avenge Aeschere against Grendel's mother; and the third part, in which Beowulf is an old man, is most preoccupied with the idea of fate, or wyrd, a kind of inescapable, inevitable doom that ...