Longer explanation
Suleiman-bin-Daoud was wise (PA). | He understood [ DO to understood what the beasts said], [ DO to understood what the birds said], [ DO to understood what the fishes said], and [ DO to understood what the insects said]. | He understood [ DO to understood what the rocks said deep {under the earth} [ Adv to said when they bowed in {towards each other} and groaned]]; | and he understood [ DO to understood what the trees said [ Adv to said when they rustled {in the middle} {of the morning}]]. | He understood everything (DO), {from the bishop} {on the bench} {to the hyssop} {on the wall}, | and Balkis, his Head Queen, the Most Beautiful Queen Balkis1 was nearly as wise (PA) [ Adv to preceding as as he was].
The words his Head Queen, the Most Beautiful Queen Balkis are appositives. Appositives are nouns that mean the same thing as the noun they follow.