If God is merciful, why is there suffering?
In short
Islam does not deny that suffering is real or painful. It teaches that this life is a test, not the final destination; that hardship can purify, strengthen and draw a person closer to God; that no soul is burdened beyond what it can bear; and that every injustice will be answered in full.
First, look at the premise
The question often assumes that a merciful God would make this world painless and that the world is the whole story. Islam rejects both assumptions. The Quran says God created death and life “to test which of you is best in deeds”. A test with no difficulty would test nothing, and a life with no hereafter would leave every injustice unanswered. Islam's answer begins by widening the frame. Philosophers also press a sharper version: why so much suffering, including that of children and animals, that seems to test no one? Muslim thinkers have answered this in several ways, and readers will weigh those answers differently.
What hardship can do
Muslim tradition describes how loss can uncover something in the heart that comfort would have left buried, such as humility, compassion for others, honesty with oneself and nearness to God. The Prophet ﷺ described the believer as someone for whom everything becomes good: gratitude in ease and patience in hardship. This doesn't make pain good in itself. It means pain is not wasted.
Permission to grieve
Patience (sabr) in Islam doesn't mean pretending not to hurt. The prophets wept. The Quran records Jacob saying he complains of his grief only to God. Faith doesn't silence the question “why?”; it gives it Someone to be addressed to.
What remains a mystery
Islam does not claim to tell anyone why a particular tragedy happened to them. The honest answer is that God's wisdom is wider than our view. Trust is not the same as having every explanation, and sometimes trust is all that is left. That is not a failure of faith; for many believers it is where faith becomes real.
Sources
ٱلَّذِي خَلَقَ ٱلۡمَوۡتَ وَٱلۡحَيَوٰةَ لِيَبۡلُوَكُمۡ أَيُّكُمۡ أَحۡسَنُ عَمَلٗاۚ وَهُوَ ٱلۡعَزِيزُ ٱلۡغَفُورُ ﴿٢﴾
He created death and life to test which of you is best in deeds. He is the Almighty, the All-Forgiving.
IslamLens paraphrase of the meaning, not a translation
Transliteration
Allathee khalaqa almawta waalhayata liyabluwakum ayyukum ahsanu ʿamalan wahuwa alʿazeezu alghafooru
وَلَنَبۡلُوَنَّكُم بِشَيۡءٖ مِّنَ ٱلۡخَوۡفِ وَٱلۡجُوعِ وَنَقۡصٖ مِّنَ ٱلۡأَمۡوَٰلِ وَٱلۡأَنفُسِ وَٱلثَّمَرَٰتِۗ وَبَشِّرِ ٱلصَّـٰبِرِينَ ﴿١٥٥﴾ ٱلَّذِينَ إِذَآ أَصَٰبَتۡهُم مُّصِيبَةٞ قَالُوٓاْ إِنَّا لِلَّهِ وَإِنَّآ إِلَيۡهِ رَٰجِعُونَ ﴿١٥٦﴾
We will certainly test you with some fear and hunger, and with loss of wealth, lives and harvests. Give good news to those who are patient, who, when hardship strikes them, say: “We belong to God, and to Him we are returning.”
IslamLens paraphrase of the meaning, not a translation
Transliteration
Walanabluwannakum bishayin mina alkhawfi waaljooʿi wanaqsin mina alamwali waalanfusi waalththamarati wabashshiri alssabireena · Allatheena itha asabathum museebatun qaloo inna lillahi wainna ilayhi rajiʿoona
فَإِنَّ مَعَ ٱلۡعُسۡرِ يُسۡرًا ﴿٥﴾ إِنَّ مَعَ ٱلۡعُسۡرِ يُسۡرٗا ﴿٦﴾
So truly, with hardship comes ease. Truly, with hardship comes ease.
IslamLens paraphrase of the meaning, not a translation
Transliteration
Fainna maʿa alʿusri yusran · Inna maʿa alʿusri yusran
لَا يُكَلِّفُ ٱللَّهُ نَفۡسًا إِلَّا وُسۡعَهَاۚ لَهَا مَا كَسَبَتۡ وَعَلَيۡهَا مَا ٱكۡتَسَبَتۡۗ رَبَّنَا لَا تُؤَاخِذۡنَآ إِن نَّسِينَآ أَوۡ أَخۡطَأۡنَاۚ رَبَّنَا وَلَا تَحۡمِلۡ عَلَيۡنَآ إِصۡرٗا كَمَا حَمَلۡتَهُۥ عَلَى ٱلَّذِينَ مِن قَبۡلِنَاۚ رَبَّنَا وَلَا تُحَمِّلۡنَا مَا لَا طَاقَةَ لَنَا بِهِۦۖ وَٱعۡفُ عَنَّا وَٱغۡفِرۡ لَنَا وَٱرۡحَمۡنَآۚ أَنتَ مَوۡلَىٰنَا فَٱنصُرۡنَا عَلَى ٱلۡقَوۡمِ ٱلۡكَٰفِرِينَ ﴿٢٨٦﴾
God does not burden any soul with more than it can bear. Each soul gains the good it has done and bears the harm it has done. [They pray:] “Our Lord, do not take us to task if we forget or make mistakes. Our Lord, do not place on us a burden like the one You placed on those before us. Our Lord, do not load us with more than we have strength for. Pardon us, forgive us, have mercy on us. You are our Protector, so help us against those who deny the truth.”
IslamLens paraphrase of the meaning, not a translation
Transliteration
La yukallifu Allahu nafsan illa wusʿaha laha ma kasabat waʿalayha ma iktasabat rabbana la tuakhithna in naseena aw akhtana rabbana wala tahmil ʿalayna isran kama hamaltahu ʿala allatheena min qablina rabbana wala tuhammilna ma la taqata lana bihi waoʿfu ʿanna waighfir lana wairhamna anta mawlana faonsurna ʿala alqawmi alkafireena
How remarkable is the believer's situation: all of it is good. If something good happens, they are grateful, and that is good for them. If hardship comes, they are patient, and that too is good for them.
Summary in our words, not a translation.
Open source text ↗Madarij as-Salikin · Ranks of the Seekers
A long commentary on the heart's stations on the way to God: repentance, hope, love, gratitude and patience.