In The Name of Allaah, The Most Merciful, The Bestower of Mercy.
[يَـٰقَوۡمِ إِن كُنتُمۡ ءَامَنتُم بِٱللَّهِ فَعَلَيۡهِ تَوَكَّلُوٓاْ إِن كُنتُم مُّسۡلِمِينَ – And Musa (Moses) said: “O my people! If you have believed in Allah, then put your trust in Him if you are Muslims (those who submit to Allah’s Will). [10:84]; Meaning: Place your trust in Allaah, return to Allaah by asking for steadfastness, aid, assistance, victory etc. Then Allaah [The Most High] says that Moosaa’s [alayhis-salaam] people replied, saying: [فَقَالُواْ عَلَى ٱللَّهِ تَوَكَّلۡنَا رَبَّنَا لَا تَجۡعَلۡنَا فِتۡنَةً۬ لِّلۡقَوۡمِ ٱلظَّـٰلِمِينَ – They said: In Allah we put our trust. Our Lord! Make us not a trial for the folk who are Zalimun (polytheists and wrong-doers (10:85)]; Meaning: Do not allow them to overpower us and thus we are put to trial in the affairs of our religion, or that they are given victory and thus we are put to trial and they say, “Had they (i.e. the believers) being upon the truth, they would not have been defeated. [وَنَجِّنَا بِرَحۡمَتِكَ مِنَ ٱلۡقَوۡمِ ٱلۡكَـٰفِرِين – And save us by Your Mercy from the disbelieving folk. (10:86)]; Meaning: Save us from their evil, so that we can practice our religion in the correct manner it should be practised- by establishing its laws and being able to manifest it without being opposed or prevented.
Then Allaah [The Most High] says that He commanded Moosaa and Haaroon [alayhimas-salaam], saying: [ وَأَوۡحَيۡنَآ إِلَىٰ مُوسَىٰ وَأَخِيهِ أَن تَبَوَّءَا لِقَوۡمِكُمَا بِمِصۡرَ بُيُوتً۬ا وَٱجۡعَلُواْ بُيُوتَڪُمۡ قِبۡلَةً۬ وَأَقِيمُواْ ٱلصَّلَوٰةَۗ وَبَشِّرِ ٱلۡمُؤۡمِنِينَ – And We inspired Musa (Moses) and his brother (saying): “Take dwellings for your people in Egypt, and make your dwellings as places for your worship, and perform As-Salat (Iqamat-as-Salat), and give glad tidings to the believers].
So when the trial became severe and they faced increased persecution at the hands of Fir’awn and his chiefs, Allaah [The Most High] commanded Moosaa and Haaroon (alayhimas-salaam] to command the believers to take dwellings in which they can perform the prayer when they are unable to perform it their places of worship; for indeed the prayer is an aid in all affairs. And besides this, they were given glad tidings that they will be given victory and that a time is coming in which they will be able to manifest their religion; for ease will come after a period of hardship.
[Source: An Excerpt from ‘Tayseer Al-Kareem Ar-Rahmaan Fee Tafseer Kalaam Al-Mannaan’ by Imaam As-Sadi (rahimahullaah)]