The boar worn on the helmets of the warriors in Beowulf was no mere imagining of the poet. Boars were commonly worn on warriors' helmets in Anglo-Saxon and Norse culture because the boar was a very important symbol, representative of ferocity in battle and loyalty to one's king. In the poem, the boar symbol is "fah ond fyrheard ferhwearde heold / guthmod grummon"—fire-hard, full of life-protection, a summoner of war-spirit. This is what the boar stood for in the minds of these warriors.
Boars were sacred to multiple gods and goddesses in the Germanic tradition. Ing is represented by the boar; he rode a boar, Hildisvini, literally "battle swine." The early commentator Tacitus in his Germania said that the Germanic warriors he encountered in the first century AD wore boarskins into battle, thinking that this would afford them the protection of the "Mother Goddess." Tacitus was writing some eight hundred years before Beowulf was written down, but Beowulf is an older story than the copy we have, and these earlier Germanic tribes were the ancestors of the Anglo-Saxons and shared the same cultural heritage. We don't know as much about Anglo-Saxon paganism as we do about other forms, but there are other references to a "mother goddess" or "great goddess" whose symbol was a boar and who was a goddess of battle and fertility, two concepts which often go hand-in-hand in Germanic pantheons. Boars have been found ceremonially buried and sacrificed, and the boar formed the centerpiece of most Anglo-Saxon festivals and ritual celebrations. The boar was intrinsic to their sense of themselves, and in wearing it on their helmets, Beowulf's warriors are reminding themselves what they are fighting for, and drawing strength from what it represents.