An Incident Relating to a Virtuous Lady
As mentioned above, Pharaoh’s wife Aasiya, daughter of Muzahim, secretly believed in the religion of the Prophet Moses. When Pharaoh learnt of this, he became incensed and commanded her execution. At that time Aasiya said this prayer which has been set forth in the Quran: “My Lord, build me a house in nearness to You in Paradise and save me from Pharaoh and his misdeeds. Save me from all evildoers.” (66:11)
This is a prayer which is fully imbued with the spirit of ism-e-aazam, the greatest name of God. In some traditions, it has been recorded that when Aasiya said this prayer, before her death she was shown her home by the angels in Paradise which she was to be awarded in the Hereafter. (Al-Qurtubi, vol. 18, p. 203)
It is certain that this prayer of Aasiya did not come out of her lips all of a sudden but rather reflected the experiences she had undergone in her life. Prior to this prayer, she had become a prepared or realized personality. She lived even before this prayer in the remembrance of God. This was why when she came to know of the utmost cruelty of Pharaoh, these rabbani (divine) words came out quite naturally from her lips.
Source: Attributes Of God