But this was not all. His manners and intellect had been trained in the court of the Pharaohs; but God, who is a greater teacher than kings, saw it necessary that his spirit should be disciplined and trained in the wilderness. It was there that he learned, more fully than he had ever understood it before, the lesson of a present and special Providence. Taken from the bulrushes and placed in a palace, and then taken from a palace and placed for forty years in a lonely desert, he felt deeply that God selects and arranges the habitations of men; and that it is man's great business, submitting on religious principles to the arrangements of Providence, to harmonize his inward state with his outward situation.
And, besides that, he wanted all this time and all this solitariness of place, in order to break up his early and unfavorable associations, to chasten and subdue his natural pride, and to imbibe that wise and gentle quietude of spirit which is one of the surest signs of a soul that dwells with God.
It was in the prisons of Egypt that Joseph received that discipline which fitted him to be the great Egyptian ruler. It was when he was tending his father's flocks in Bethlehem, or when he was driven into mountains and caverns, that the hand and soul of David were trained and strengthened to the great task of holding a nation's scepter. Daniel was taught of God in the lion's den; and Paul was aided in learning the great lesson of entire dependence, when he could find no escape from persecution, and perhaps from death, but by being let down by a basket over the wall of Damascus.
— edited from A Treatise on Divine Union (1851) Part 6, Chapter 5.