This question strikes at the heart of the Germanic heroic code. In Beowulf, that code is re-enforced through its emphasis on wealth, fame and honor (or to use the Roman phrase for this, the comitatus). A Germanic culture was strong when people adhered to the three legs of generosity, loyalty, and bravery. This code is declared in the prologue's description of Sheild Sheafson, against whom other figures in the poem will be judged:
There was Shield Sheafson, scourge of many tribes,
A wrecker of mead-benches, rampaging among foes.
This terror of the hall-troops had come far.
A foundling to start with, he would flourish later on
As his powers waxed and his worth was proved.
In the end each clan on the outlying coats
Beyond the whale-road had to yield to him 10
And begin to pay tribute. That was one good king.
Afterwards a boy-child was born to Shield,
A cub in the yard, a comfort sent
By God to that nation. He knew what they had tholed*,
The long times and troubles they’d come through
Without a leader; so the Lord of Life,
The glorious Almighty, made this man renowned.
Shield had fathered a famous son:
Beow’s name was known through the north
and a young prince must be prudent like that, 20
Giving freely while his father lives
so that afterwards in age when fighting starts
steadfast companions will stand by him
and hold the line. Behaviour that’s admired
is the path to power among people everywhere.
A king needed to give gifts "freely," which implies that he needed to seek wealth, often through plundering "mead-halls" or earning "tribute" in battle. This generosity guarantees security. A warrior needed to fight bravely, often in pursuit of the wealth the king seeks. And together they must be loyal to each other as they uphold their part of the comitatus. A young warrior gains fame and honor (immediate stardom but also a sense of integrity) by fighting well for good causes. Beowulf does so by choosing to rid the water of dangerous creatures rather than just win a swimming match, by fighting Grendel, and by seeking out Grendel's mother. He is famed as a supremely brave fighter but he gains honor in his paying tribute to Hrothgar, allowing the old king to regain his dignity.
An honor-based culture seems to secure itself against all but the most monstrous of dangers. Hrothgar and later Beowulf are, like Sheild Sheafson, admirable kings for whom warriors rightfully should fight to increase wealth. Only supernatural threats like Grendel and the dragon prove too much for the tight-knit warrior culture these kings foster. Their fame, however, remains undisputed, as evidenced by the poem itself.