God called Abraham, Isaac and Jacob. He made a covenant with them. He promised to bless them with great prosperity. He also promised that Jesus Christ would descend from them. And even when Abraham, Isaac and Jacob kept messing up, God forgave them and transformed them. God led this family into Egypt, but He inexplicably abandoned them to four hundred years of slavery. Why did God allow this?
God answered [this question] for us in a conversation He has with the Pharaoh of Egypt. ‘But I have raised you up for this very purpose that I might show you my power and that my name might be proclaimed in all the earth’.
Exodus 9:16 NIV
Essentially, God is revealing that the 400 years of slavery was for his name to be proclaimed in all of the earth. Mission.
Therefore, the 400 years of suffering in Egypt was not mindless. It was with a purpose and the purpose was mission (for all nations to know about God.)