How was it determined that Scyld Scefing would be king?
Oft Scyld the Scefing from squadroned foes, from many a tribe, the mead-bench tore, awing the earls. Since erst he lay friendless, a foundling, fate repaid him: for he waxed under welkin, in wealth he throve, till before him the folk, both far and near, who house by the whale-path, heard his mandate, gave him gifts: a good king he!
Much is to be assumed from these the opening lines of Beowulf. They are, essentially, a geneaology of the Scyldings, or Danes. This tribe's name came from a mythological orphaned hero (a "foundling") named Scyld Scefing. He showed up on the shore (of what would become his land) as a baby, on a ship mysteriously full of treasure.
It is assumed, therefore, that he rose to power based on his strength of character. Likely, he displayed many of the same virtues seen later in Beowulf, deemed worthy of honor and respect by Anglo-Saxons. People were willing to follow him, and for this, "fate repaid him," suggesting that he was able to turn from his original orphaned state, and make a great name for himself. "He was a good king!"