Though now in the deepest of his life’s trenches, God is still with Joseph (Genesis 39:21). His fellow inmates, Pharaoh’s former butler and his former baker, both dream symbolic dreams, and Joseph’s skills as a dream-interpreter are put to use. He predicts that the butler will be exonerated in three days and restored to Pharaoh’s service, and that the baker will be put to death. Joseph’s interpretations come true.
The fate of Joseph, in the Hebrew text the Book of Genesis, chapters 37 to 50, is that of rising from slavery and imprisonment to power, a journey shaped by constant divine intervention from God. Joseph's life is somewhat governed by divine agency. While serving prison time, Joseph accurately interprets the dreams of Pharaoh's former cupbearer and his baker, predicting that the former cupbearer would be restored to his old position and that the baker would die. This is explained by God's presence with him (Genesis 39:21). To his phenomenal guidance to power in the court of Pharaoh, ‘his divine gift’ enables this rise. (https://www.myjewishlearning.com/article/the-story-of-joseph/, accessed 5/10/25). On the other hand, Ferdowsi shapes the Persian hero’s destiny as entirely a product of ethical struggle and human choices in Shahnameh with no gods. CC BY-NC-ND