In the Bible, Joseph was a son of Jacob. Joseph's brothers hated him, because he was their father's favorite son, and his father gave him a coat which was said that it was revealed from heaven. One day they decided to kill him but changed their minds. According to Genesis they sold him as a slave. In Islamic tradition they threw him in a large well that had only a little salt water but when he drank it, by the will of God, it was very sweet. A passing caravan found him and took him as a slave to Egypt.
Joseph became the slave of the chief of the Pharaoh's guards but was put in prison, where he interpreted the dreams of other prisoners. The Pharaoh heard of his power and asked for interpretations of his own dreams. Joseph became the Pharaoh's prime minister. This caused the Israelites to leave Canaan and live in Egypt.