Praise be to Allah.
Shaykh Ibn Sa’di (may Allaah have mercy on him) said:
Allaah protected them from the sun, so He guided them to go into a cave, and when the sun rose it declined to the right and when it set it declined to the left, so that its heat would not reach them and cause their bodies to decay.
“while they lay in the midst of the Cave”
i.e., in the middle of the cave which was a spacious area. That was so that they might have some air and breezes, and so that they would not decay or disintegrate in a narrow space, especially since they remained there for so long. This was one of the Signs of Allaah which points to His power and His mercy towards them, and it was a response to their prayers, and guided them and took care of them. Hence Allaah says (interpretation of the meaning):
“He whom Allaah guides, he is the rightly-guided”, i.e., there is no way to attain true guidance except from Allaah, for He is the true Guide who shows the way to that which is best in this world and in the Hereafter.
“but he whom He sends astray, for him you will find no Wali (guiding friend) to lead him”
i.e., you will not find anyone to help him or guide him towards that which is good for him, because Allaah has decreed that he is to be misguided and there is none who can overturn His ruling.
See Tayseer al-Kareem al-Rahmaan, p. 472.