The Quran says that God will certainly test people with some fear, hunger and loss of wealth, lives and fruits, and gives good news to those who are patient. It also says that with hardship comes ease, and God does not burden a soul beyond its capacity. Muslims see in suffering a chance for growth, humility and a closer link to God, and for others a call to help.
Muslims also believe that much suffering comes from human injustice that God allows because He has given people free choice, and that in the next life, all wrongs will be put right: the oppressed will receive justice and an innocent child's pain will be answered with a great reward. Like every faith, Islam does not claim to explain every case, and it asks for trust in God's wisdom.