When God promised Abraham that He would bless the nations through his seed, it would be ultimately fulfilled in Christ but it was partially fulfilled in the oddest of circumstances: through the civil magistrate. Abraham’s great-grandson, Joseph, would ascend to the highest place of political power second only to the Pharaoh of Egypt and, through his wisdom, would preserve the nations from starvation.
But before Joseph was an example of faith under extreme suffering he was a fairly brash young man who was the favorite of a father who showered too much attention on the son of his beloved Rachel and excluded his elder Brothers. Joseph took seeming great delight in relating dreams of his eventual ascendancy to authority and his brothers responded with disgust and, eventually, full hatred toward Joseph.
The family situation demonstrates the imperfect nature of the Saints of God and that God justifies the un-Godly and works all things together for those who love Him and are called according to His purposes. Through a series of connected events, God superintended the schemes of unloving brothers to sell their brother into slavery toward the eventual reconciliation of a family while also preserving their life through which the Savior of the world would eventually come.