It's unknown whether this was:
- a name of the king of the Amalekites
- a title of the king of the Amalekites
- a Hebrew epithet for any of the above or any leaders of the adversaries of Israel
From the International Standard Bible Encyclopedia:
AGAG āʹgag [Heb. ’ag̱āg̱].
- The name or title of an Amalekite king mentioned by Balaam (Nu. 24:7).
- Another Amalekite king defeated by Saul but spared, along with the choicest spoil, in contravention of the divine command (1 S. 15:8f).
After rebuking Saul, Samuel himself killed Agag for all the Amalekite
AGAGITE ā‘gag-īt [Heb. ’ag̱āg̱î—‘member of the house of Agag’]. An
opprobrious adjective applied to Haman (Est. 3:1, 10; 8:3, 5; 9:24).
Jewish tradition has always credited the adversaries of the nation
with membership in the house of Amalek, the hereditary foe of Israel.
The LXX has Bougaíos in Est. 3:1 and Makedōn (Macedonian) in 9:24, to
signify “enemy.” See BOUGAEAN.
Bromiley, G. W. (Ed.). (1979–1988). Agagite. In The International Standard Bible Encyclopedia, Revised (Vol. 1, pp. 65–66). Wm. B. Eerdmans.
See also the Harper Collins Bible Dictionary:
Agag (ay´gag). The apparent name of two non-Israelite kings, though
some scholars speculate that Agag might not be a proper name, but a
designation (analogous to “Pharaoh”) for all Amalekite rulers. 1 The
name of an unknown king referred to in Num. 24:7 (called “Gog” in the
LXX). Balaam prophesies that Israel’s future king will be more exalted
than Agag. 2 The name of the king of the Amalekites whom Saul defeated
but spared, contrary to divine command. After rebuking Saul bitterly,
Samuel hewed Agag to pieces in Gilgal “before the LORD” (1 Sam. 15).
Powell, M. A. (2011). Agag. In M. A. Powell (Ed.), The HarperCollins Bible Dictionary (Revised and Updated) (Third Edition, p. 15). New York: HarperCollins.
Note that this is similar to 'Gog', which is just Agag without the Aleph, which reinforces the idea of this being an epithet.
Gog, a king who, in Ezek. 38–39, is described as an apocalyptic figure
who marches from the north (38:6, 15; 39:2) and ravages Israel before
being destroyed by God (38:19–22; 39:3–5). This mythical or
eschatological ruler is probably based on the historical figure of
Gyges, a seventh-century BCE king of Lydia. In describing his
activities, Ezekiel is thought to draw upon Jeremiah’s writings about
an “enemy from the north” (1:14; 4:6; 6:1, 22; 10:22; 13:20) as well
as on Isaiah’s motif of the destruction of Israel’s foes on the
mountains of Israel (14:24–25; 17:12–14; 31:8–9). Gog reappears in the
NT, paired with Magog (Rev. 20:8–10); in Ezek. 38:2 Magog is probably
not a ruler, but a phrase from the Akkadian language (mat Gog) meaning
“land of Gog.”
Kselman, J. S. (2011). Gog. In M. A. Powell (Ed.), The HarperCollins Bible Dictionary (Revised and Updated) (Third Edition, p. 334). New York: HarperCollins.