Psalm 110 is a fascinating hymn written to honor the king of Israel and the King above him. It has special application to King David, but was likely sung on other occasions in honor of later kings of Israel. Since Jesus the Messiah is (among other things) King of Israel and descendant of David, Psalm 110 also can be applied to him (as we find in Matt 22:41-46, Acts 2:34-36, and Hebrews 1:13, and chs. 5-7).
The opening line is perhaps a little clearer in this translation from Hebrew: "Yahweh said to my master (adonai)..." This Psalm pictures God speaking a war-blessing over the king of Israel. The king will rule even with enemies around (v. 2); the people of Israel will serve in battle willingly (v. 3), the enemies will be defeated (vv. 5-6); and after war, the king will receive refreshment and rest from God (v. 7).
Verse 4 seems rather strange to us today. Why would a war-blessing describe the king of Israel as "a priest forever according to the order of Melchizedek"? There is a somewhat convoluted story behind this title. Jerusalem (earlier called Jebus, even earlier called Salem) was under the control of the Jebusites until the time of David. After becoming king, David captured the city and made it his capital (2 Samuel 5:6-10). By ancient custom, he thus acquired the title of the previous king of Jerusalem - Melchizedek. This word, meaning "righteous king," was possibly a hereditary title rather than a personal name. As in other ancient near eastern cities, the king of Jerusalem was also the city's high priest. In the time of Abraham, the king of Jerusalem (Salem) served El Elyon - the Most High God (Gen 14:18-20). Of course, Gen 14 refers to events over 1000 years before David, so we have no idea if the Jebusite kings of Jerusalem still served El Elyon at the time of David. They were still using the hereditary title Adoni-zedek (Master of Righteousness) at the time of Joshua (Josh 10:1).
So the original meaning of the psalm was that God had provided David with victory over Jerusalem, a new title, and rest from war. In later generations, the psalm could be sung in faith that God would again provide victory to other faithful kings. As the NT points out, Ps 110 ultimately applies to Jesus, the Son of David and greatest king of Israel. Jesus' victory is over the evil powers, and is accomplished at the cross (Acts 2:33-36). Like the kings before him, Jesus has the title of "priest forever according to the order of Melchizedek," which allows him to serve as a unique mediating priest between God and people (Hebrews 5-7). Like David, Jesus had rest after his battle was complete (Ps 110:7).
Additional note: The Hasmonean dynasty ruled over Israel from about 140 BC to 37 BC, before being replaced by the Herodian dynasty. The Hasmoneans were neither decendents of David nor Aaron, but they served as both kings and high priests. The last direct descendents of Aaron had died or fled Israel, so there were few options for filling the role of high priest.They justified their priestly role by their descent from a non-Aaronic priestly line and on the concept of the Melchizedekan priesthood. Since they ruled Jerusalem, they reasoned that they could inherit the high priestly role. The application of this priesthood to Jesus in Hebrews was understandable to Jews of the first century, many of whom looked back on the Hasmonean dynasty with some fondness.
The picture: Communion of the Knight, ca. 1250, depicting Melchizedek blessing Abraham, in Notre Dame de Reims. This cathedral was the coronation site for the kings of France, making an interesting connection to Genesis 14 and Ps 110.