From John Newton's An Authentic Narrative:

How many such casual events may we remark in the history of Joseph, which had each a necessary influence in his ensuing promotion!  If he had not dreamed, or if he had not told his dream; if the Midianites had passed by a day sooner or a day later; if they had sold him to any person but Potiphar; if his mistress had been a better woman; if Pharaoh's officers had not displeased their lord; or if any, or all these things had fallen out in any other manner or time than they did, all that followed [would have] been prevented:  the promises and purposes of God concerning Israel, their bondage, deliverances, polity, and settlement, must have failed; and, as all these things tended to, and centred in Christ, the promised Saviour, the desire of all nations would not have appeared; mankind had been still in their sins, without hope, and the counsels of God's eternal love in favour of sinners defeated.  Thus we may see a connection between Joseph's first dream and the death of our Lord Christ, with all its glorious consequences.  So strong, though secret, is the concatenation between the greatest and the smallest events.  What a comfortable thought is this to a believer to know, that amidst all the various interfering designs of men, the Lord has one constant design which he cannot, will not miss, namely, his own glory in the complete salvation of his people; and that he is wise, and strong, and faithful, to make even those things, which seem contrary to this design, subservient to promote it.

I can only respond with the words of Romans 11:33 and Psalm 139:6:  Oh, the depth of the riches both of the wisdom and knowledge of God!  It is too wonderful for me; it is too high, I cannot attain to it.