Genesis 39 takes us back to the story of Joseph who has been sold by his brothers into slavery.
He ends up at the head of security in Egypt. God's hand is on him, and it is so obvious, that the Egyptians all see it.
What a contrast from chapter 38 to 39