What we are going to see through this story is the biblical theology concept known as typology. This is taken from what Paul says in Rom. 5:14 of Adam being a "type, typos" of Christ. The idea of typology is that when we read the OT what we see is a foreshadow, a glimpse, a taste, a pattern, a sample of the full fulfillment of the covenant promises.
This avoids the allegorical interpretation of the OT which leaves the reader always looking for a deeper meaning to every event. An allegory is defined as a story, poem or picture that can be interpreted to reveal a hidden meaning. Pilgrim's Progress is an allegory for the spiritual journey. The allegorical framework allows one to read any deeper meaning into the events of the OT regardless of its connection to the NT. By contrast the typological framework demands a fulfillment of the OT person or event in the NT. It allows Scripture to interpret Scripture.
Let's look at a couple of examples:
Romans 5:14 14 Yet death reigned from Adam to Moses, even over those whose sinning was not like the transgression of Adam, who was a type of the one who was to come.
Paul explains what he means in the next few verses:
Romans 5:18–21 18 Therefore, as one trespass led to condemnation for all men, so one act of righteousness leads to justification and life for all men. 19 For as by the one man’s disobedience the many were made sinners, so by the one man’s obedience the many will be made righteous. 20 Now the law came in to increase the trespass, but where sin increased, grace abounded all the more, 21 so that, as sin reigned in death, grace also might reign through righteousness leading to eternal life through Jesus Christ our Lord.
Paul is here pointing to the pattern of God's working. Adam, as a type of Christ, by his disobedience brought sin into the world, essentially infecting all humanity with a sinful nature leading to death. In a similar pattern but opposite trajectory Jesus through his righteousness and sacrifice brought eternal life and made it available to all humanity. So in Adam we catch a glimpse of God's pattern of working and see a foreshadowing of the Messiah.
For our next example we look at 1 Peter chapter 3:
1 Peter 3:21 21 Baptism, which corresponds to this, now saves you, not as a removal of dirt from the body but as an appeal to God for a good conscience, through the resurrection of Jesus Christ,
The word "corresponds" here is antitypos. It is derived from the same root word typos in Rom. 5:14. This passage and the broader context of it have left many readers of the NT scratching their heads in confusion. Without diving too much into it, Peter is applying a typological interpretation method here. He is essentially using the flood of Noah's day and God's rescue of Noah and his family through the ark as a type to illustrate how God is saving his readers today in the spiritual sense. The flood was God's judgment after long years of restraint and patience with his sinful creation. The ark was God's salvation of Noah and his family. Now for the Christian, salvation from God's judgment is found in salvation through the resurrection of Jesus and repentance, which is symbolized by baptism. Instead of reading the flood as an allegory we should read it as a type, pointing to how God works and how God saves.
If you're lost and confused, give it time. As we go through story of Joseph we will reference back to this post and see how this works.
So this is how we ought to view this story and so many of the OT stories and characters. You get a partial picture, a foreshadow, a pattern, or a taste of the fullness to be revealed in the Messiah. They leave you longing for more. As we read these stories we should put ourselves in the place of these characters and understand their longing for the Messiah and appreciate our privileged place in history to have known and experienced the Messiah. It's like doing a puzzle. When you explore the life of Joseph, or Moses or David or Abraham, you get pieces of the picture of the Messiah but not the full thing. Or like when you are at the grocery store and you get a sample of the cheese, which only leaves you wanting the full block of cheese. What Wisconsinite can be satisfied by one measly chunk of cheese?