Deuteronomy 8:2 Remember how the Lord your God led you all the way in the desert these forty years, to humble you and to test you in order to know what was in your heart, whether or not you would keep his commands.

Commentary:

Humility, faith, perseverance all bring mankind to recognize that God is in control of the universe. We are free to believe this or not to believe this. Our trials are often given to us so that we can draw our strength from God instead of mankind