Genesis 14 starts out as a rollicking adventure story--a military conquest sweeps through the area where Abraham's nephew Lot was living, and carries him away. So Abraham has to chase down the army with his own warband of 318 men, conquering the enemy, rescuing Lot, and returning with plunder. As exciting as that story is, our main interest in it focuses on what happens next, because the aftermath of this rescue brings up one of the clearest foreshadowings of Christ in the entire Old Testament (although some early church fathers also liked to point out a very subtle foreshadowing of the church within that rescue story: just as Abraham won his victory with 318 men, so there were 318 bishops at the Council of Nicea in 325 AD, which triumphed over the heresy of Arianism and rescued the true and orthodox Christian faith).
In Gen. 14:18-20, the victorious Abraham is greeted upon his return by a mysterious character, who only appears this one time in the Genesis story. He is described as "Melchizedek, the King of Salem...a priest of God Most High." Three things happen in quick succession in these verses: (1) Melchizedek brings out bread and wine; (2) Melchizedek blesses Abraham; and (3) Abraham gives Melchizedek a tenth (that is, a tithe) of all he has.
What do we make of this? Well, there are a few things to notice about this character right off the bat. First, we need to point out that we know absolutely nothing about him historically--we don't know his ethnicity, his genealogy, or even where he lived (although some have suggested that it might have been Jerusalem, given the similarity of the last part of that city's name with the description of Melchizedek as "King of Salem"). The author of Hebrews puts great stock in the fact that Melchizedek seems to come out of nowhere, intimating that this indicates him as a representative of a different, eternal priesthood, not dependent on time, place, or ancestry. In essence, Hebrews 7:1-10 argues that the primary meaning of the character of Melchizedek was not even as a historical person, but as a foreshadowing of Christ. Most of the connections with Jesus that we'll notice are derived from that passage in Hebrews.
The name "Melchizedek" itself is not really a name so much as a title; it literally means "King of Righteousness" (melch = king; zedek = righteousness). He is also described as the King of Salem, and "salem" is derived from the Hebrew word for peace. So, as the book of Hebrews points out, we have here a character who is both a king and priest (and not just any priest, but a priest of the one true God, which would have been unthinkably rare in Canaan at that time); who is named "King of Righteousness" and "King of Peace," who blesses Abraham (and, as Hebrews notes, it is the place of the greater person to give a blessing over the lesser, thus meaning that Melchizedek was greater than the patriarch); and to whom Abraham offers a tithe--an action usually associated with giving sacrifices to God himself. So here in this odd little passage in Genesis, we have a character who checks off all the boxes of a foreshadowing of Christ: a king and a priest, who bears peace and righteousness in his very identity, who appears to act in the place of God by blessing Abraham, and whom Abraham treats as God by offering him a tithe. As if that weren't enough, a clearly prophetic reference to Melchizedek in Psalm 110 (a psalm that Jesus later applies to himself as the Messiah) drives home the point that this character is intended to give us a vision of what God's Messiah, his divine Priest-King, will be like.
There's one final element of this story that also points to Jesus, though--an element that not even the author of Hebrews commented on. Genesis tells us that Melchizedek brought out bread and wine. In a historical sense, this may not seem surprising--it would be a normal act of hospitality toward Abraham and his warband, who were likely hungry after their chase. But when we consider that this Melchizedek is clearly acting as a foreshadowing of Christ, then the fact that the one concrete action he is described as doing is to offer bread and wine takes on a deeper significance. We have here a foreshadowing of holy Communion, the Eucharist--the bread and the wine, which are among the clearest symbols in all of Scripture for the presence of Christ. This is not the only place where we will see foreshadowings of Communion arising in the Old Testament, but it is one of the most remarkable.