When we left Joseph at the end of chapter 40, he was alone, forsaken, forgotten in the depths of the prison. Remember how he got there. He was the favoured son, a young man in-home his father delighted, and upon whom God’s favour rested. His visions of supremacy over his brothers, supposedly given him from God, enraged them to the point at which they despised and rejected him. Although they initially planned to kill him themselves, Judah sold him for the price of a slave, delivering him over to a group of Gentiles. Although God was with him and no guilt was found in him, he was falsely accused of sin, and unjustly sentenced to prison where he was forsaken and forgotten.
When we pick up the story in Genesis 41, we find that Joseph has been languishing in prison for over two years. Thus, in the third year of his imprisonment, the circumstances of chapter 41 can be fairly described as a miraculous resurrection. More than that - a miraculous resurrection and ascension, orchestrated by God for the deliverance of the world.