لِمَنْ كَانَ لَهُ أَهْلًا
For one who is deserving of it.
The believer answers the questions and receives relief. The unbeliever fails to give the answers and experiences punishment. The qualification ahlan makes clear that punishment is not declared inevitable and equal for every buried person.
Questioning, the believer's firmness and liability to punishment are therefore distinct matters.