Joseph had been thrown by his jealous brothers into a pit and then sold into slavery. He was deposited in Egypt. There, he survived, then thrived, and eventually became Prime Minister.