They were four kingdoms. The Holy Spirit used horns poetically as a symbol of power. When used in context associated with YHVH, as in 2 Sam. 22:3 and Psa. 18:2 as "the horn of my salvation" it has the positive connotation of the strength and power of our Almighty Protector.
When used in prophesy of judgments announced for the down fall of Israel or Judah, the metaphor became an aggressive action of destruction from foreign nations and armies. Horns were kings or kingdoms of world powers. (1) (2)
As generally can be found, the Holy Spirit provided the definitions / meanings of His metaphors.
Dan. 7:24, "... And the ten horns out of this kingdom are ten kings that shall arise:" (KJV)
So, when used in prophesy horns were symbols of kings, and powerful rulers.
Zechariah 1:1 identifies the time of this vision which was under the 2nd world power identified in Daniel 2 - the Medes and Persians.
Zech 1:1, "In the eighth month, in the second year of Darius,..."
So Nebuchadnezzar's kingdom, the Babylonian world power had already fallen to the second world power of these visions. And, in vs. 12 -
"Then the angel of the LORD answered and said, O LORD of hosts, how long wilt thou not have mercy on Jerusalem and on the cities of Judah, against which thou hast had indignation these threescore and ten years?" (KJV)
we know that 70 years of the exile had been completed when this vision occurred. So, the return to Jerusalem had begun (3). The context of the visions concerned and centered around Jerusalem, for whom YHVH was jealous (vs. 14).
The four "horns" or powers were then associated with four kings / kingdoms that would affect Jerusalem (vs. 19). The four horns of vs. 21 were those world powers that had or would scatter Judah - namely Babylon, Medo-Persian (contemporary with Zechariah), then the Greco-Macedonian, followed by the fourth - the Roman empire.
Excerpt from Barnes Notes on Zech. 1:21:
"These are the horns which have scattered - o "The four horns which scattered Judah, Israel and Jerusalem, are four nations, Babylonians, Medes and Persians, Macedonians and Romans; as the Lord, on the prophet's enquiry, explains here, and Daniel unfolds most fully Daniel 2; who in the vision of the image with golden head, silver breast, belly and thighs of brass, feet of iron and clay, explained it of these four nations, and again in another vision of four beasts Daniel 7, lion, bear, leopard and another unnamed dreadful beast, he pointed out the same nations under another figure. But that the Medes and Persians, after the victory of Cyrus, were one kingdom, no one will doubt, who reads secular and sacred literature. When this vision was beheld, the kingdom of the Babylonians had now passed away, that of the Medes and Persians was instant; that of Greeks and Macedonians and of the Romans was yet to come.
What the Babylonians, what the Medes and Persians, what the Greeks that is, the Macedonians, did to Judah, Israel and Jerusalem, a learned man acknowledgeth, especially under Antiochus, surnamed Epiphanes, to which the history of the Maccabees belongs. After the Coming of our Lord and Saviour, when Jerusalem was encompassed, Josephus, a native writer, tells most fully, what the Israelites endured, and the Gospel fore-announced. These horns dispersed Judah almost individually, so that, bowed down by the heavy weight of evils, no one of them raised his head." Though these were successive in time, they are exhibited to Zechariah as one. One whole are the efforts against God's Church; one whole are the instruments of God, whether angelic or human, in doing or suffering, to repel them. Zechariah then exhibits these hostile powers as past and gone, as each would be at the end, having put forth his passing might, and perishing. They scattered, each in its day, and disappeared; for the next displaced it." Source Biblehub
The use of the present perfect tense "have scattered" is from YHVH's perspective of omniscience. The action was determined, and though only part of it had already happened YHVH knew what would happen, and considered it a "done deal". Much as some people say "dead man walking", and "he just doesn't know it yet".
The Horn as a Symbol - here
The Horn Motifs in the Bible and the Ancient Near East by Margit L Suring, 1984 -
Zechariah Overview - [here]
: https://www.insight.org/resources/bible/the-minor-prophets/zechariah![enter image description here](https://i.stack.imgur.com/ItGkw.jpg)