Their Sleep in the Cave
Some of the scholars mentioned that when Allah caused them to sleep, their eyelids did not close, lest disintegration took hold of them. If their eyes remained open to the air, this would be better for the sake of preservation.
Allah says;
وَتَحْسَبُهُمْ أَيْقَاظًا وَهُمْ رُقُودٌ
And you would have thought them awake, whereas they were asleep.
It was mentioned that when the wolf sleeps, it closes one eye and keeps one eye open, then it switches eyes while asleep.
وَنُقَلِّبُهُمْ ذَاتَ الْيَمِينِ وَذَاتَ الشِّمَالِ
And We turned them on their right and on their left sides,
Ibn Abbas said;
"If they did not turn over, the earth would have consumed them."
وَكَلْبُهُم بَاسِطٌ ذِرَاعَيْهِ بِالْوَصِيدِ
and their dog stretching forth his two forelegs at the Wasid,
Ibn Abbas, Mujahid, Sa`id bin Jubayr and Qatadah said;
"The Wasid means the threshold."
Ibn Abbas said;
"By the door."
It was said;
"On the ground."
The correct view is that it means on the threshold, i.e., at the door.
إِنَّهَا عَلَيْهِم مُّوْصَدَةٌ
Verily, it shall be closed upon them. (104;8)
Their dog lay down at the door, as is the habit of dogs.
Ibn Jurayj said,
"He was guarding the door for them."
It was his nature and habit to lie down at their door as if guarding them. He was sitting outside the door, because the angels do not enter a house in which there is a dog, as was reported in As-Sahih, nor do they enter a house in which there is an image, a person in a state of ritual impurity or a disbeliever, as was narrated in the Hasan Hadith.
The blessing they enjoyed extended to their dog, so the sleep that overtook them overtook him too. This is the benefit of accompanying good people, and so this dog attained fame and stature.
It was said that he was the hunting dog of one of the people which is the more appropriate view, or that he was the dog of the king's cook, who shared their religious views, and brought his dog with him.
And Allah knows best.
Allah says;
لَوِ اطَّلَعْتَ عَلَيْهِمْ لَوَلَّيْتَ مِنْهُمْ فِرَارًا وَلَمُلِيْتَ مِنْهُمْ رُعْبًا
Had you happened upon them, you would certainly have turned back from them in flight, and would certainly have been filled with awe of them.
meaning that Allah made them appear dreadful, so that no one could look at them without being filled with terror, because of the frightening appearance they had been given. This was so that no one would come near them or touch them until the appointed time when their sleep would come to an end as Allah willed, because of the wisdom, clear proof and great mercy involved in that.