What does Genesis 40:1 mean?
Joseph (Genesis 37:28) is in prison in Egypt. His jail is specially dedicated to the king's prisoners, and is somehow attached to the home of Potiphar, the captain of the guard (Genesis 40:3). Potiphar is Joseph's former master (Genesis 39:1–6). Joseph was falsely accused by Potiphar's wife of attempted rape (Genesis 39:11–20).Although Joseph's circumstances are difficult, the Lord remains with him. God continues to bless Joseph with great success in everything he does. In fact, the keeper of the jail has put Joseph in charge of most of what goes on in the prison. While Scripture does not say exactly how long this has been, it has not been a brief stay. Joseph has been jailed for years and naturally wants to get out.
Two more high-ranking servants are added to the prison: the cupbearer and baker of Pharaoh, the Egyptian ruler. A cupbearer was an especially trusted servant who may have monitored the process of the winemaking from grapes to cup. Part of his role was to ensure, for instance, that the king was not poisoned. The king's chief baker may have supervised a team of bakers. Both men had committed an unnamed offense against the king. In the case of these two men, guilt is certain, as opposed to Joseph, who had been falsely accused.