The genitive phrase King of Kings (Assyrian šar šarrāni, Hebrew מֶלֶךְ מְלָכִים melek mĕlakîm) is a superlative expression for "great king" or high king; it is probably originally of Semitic origins (compare the superlatives Lord of Lords, Song of Songs or Holy of Holies), but from there was also adopted in Persian (Shahanshah), Hellenistic and Christian traditions.
The first king known to use the title "king of kings" (šar šarrāni) was Tukulti-Ninurta I of Assyria (13th century BC). The title used to be intended quite literally, as a šar or mlk was the title of a king of a city-state, and with the formation of an empire in the Late Bronze Age, the Assyrian rulers installed themselves as rulers over the existing structure of rulers (kings) of city-states.
The title was adopted in Biblical Hebrew, as מֶלֶךְ מְלָכִים, in refence to Babylonian king Nebuchadnezzar in Ezekiel 26:7. The same usage appears in Aramaic portions of the Book of Daniel 2:37, where Nebuchadnezzar is called מֶלֶךְ מַלְכַיָּא.