In the battle of Khandaq (the trenches) the Prophet (peace and blessings be upon him) was able to break a huge rock that the companions had been unable to remove. With the first blow he said he saw the Palace of Caesar. With the second blow, he said he saw the Palace of Kisra, the Persian king. With the third blow, he said he saw the collapse of the palaces in San’ah, Yemen. In this way he gave the glad tidings for the coming spread of Islam to these lands, thus injecting the hope of a prospective triumph into the hearts of the believers. He was giving the glad tidings that truth would prevail over falsehood and was drawing a map of the universe in which that which had been impossible would now become possible, one after another.
The battle of Khandaq was one of great pain, fatigue, hunger, cold, and darkness. The Messenger of Allah (peace be upon him) prayed:
“O my Lord! The real life is the life of the Hereafter, please help the Helpers (Ansar) and the Immigrants (Muhajirun).”
In these prayers he was explaining that the all pain and fatigue of this world are insignificant compared to the infinity of the Hereafter, and was thus orienting his Companions to adopt the Hereafter as their goal.