Herod the Great, who was Herod's father and King of Judea during the birth of Christ, had been granted his title by the Roman Senate. As King, he had authority over all Judea and surrounding territories.
Upon the death of Herod the Great, his kingdom was divided among his sons, with Herod Archelaus inheriting the land of Judea, Samaria, and Idumea; Herod Antipas inheriting Galilee and Peraea; and Philip inheriting the land northeast of the Jordan.
Whereas Herod the Great had ruled with an iron fist, things became chaotic under his sons - especially in Archelaus' tetrarchy. As a result, Augustus Caesar removed Archelaus as tetrarch and placed the territory - which became the Roman province of Judea - directly under the control of a Roman prefect. Pontius Pilate was the fifth prefect of the Province of Judea.
Following Herod the Great's death, Herod Antipas (the Herod of Luke 23:12) had gone to Rome to lobby to inherit his father's kingdom in toto, but his request was denied. This, as well as Rome's decision to install a Roman prefect rather than one of Herod's descendants in place of Archelaus - probably led to Herod Antipas' resentment of the Roman prefecture in general and of Pilate in particular.
(The above information can be found in the works of Josephus (Yosef ben Matityahu), a Jewish rebel against Rome who defected and himself became a Roman citizen and chronicler of Jewish history.)
The Byzantine commentator Theophylact (1055-1107) calls attention to the dark amity of Pilate and Herod as a stark reminder for us:
See how the devil brings together disparate elements for the sole
purpose of preparing Christ's death, forging a single conspiracy and
making warring factions friends. Are we not then ashamed that the
devil brings peace between enemies in order to kill Christ, while we,
for the sake of our own salvation, do not even preserve love towards
our own friends?1
Cyril of Jerusalem (313-386) relates the friendship concluded between Pilate and Herod to a prophesy in Hosea (10:6) and takes a somewhat more positive view of Herod's and Pilate's friendship:
Having been bound, He came from Caiaphas to Pilate,—is this too
written? yes; And having bound Him, they led Him away as a present to
the king of Jarim2. But here some sharp hearer will
object, “Pilate was not a king,” (to leave for a while the main parts
of the question,) “how then having bound Him, led they Him as a
present to the king?” But read thou the Gospel; When Pilate heard
that He was of Galilee, he sent Him to Herod; for Herod was then
king, and was present at Jerusalem. And now observe the exactness of
the Prophet; for he says, that He was sent as a present; for the same
day Pilate and Herod were made friends together, for before they were
at enmity. For it became Him who was on the eve of making peace
between earth and heaven, to make the very men who condemned Him the
first to be at peace; for the Lord Himself was there present, who
reconciles the hearts of the princes of the earth. Mark the exactness
of the Prophets, and their true testimony.3
1. Explanation of the Gospel According to St. Luke, tr. from Greek by Chrysostom Press
2. "Jarim" means "wild vine". Herod, points out Rufinus (340-410), was himself a wild vine, since he was of alien and not Jewish stock.
3. Catechetical Lecture XIII.14