It is narrated that Imam Ali (AS) was sitting near a wall and noticed that it was broken and it was possible for it to collapse, so he immediately stood up and moved away from there. A man asked Imam (AS):
Are you escaping from Divine Judgment (Qadha)? Imam Ali (AS) replied: I escape from Divine Judgment to Divine Decree (Qadr) [1]. In another Hadith (narration), the Prophet of Islam (PBUH) was asked: Knowing that all incidents/events which occur in the world are according to Divine Qadha and Qadr, what effect can Dua (prayers to God) have? The holy Prophet (PBUH) replied: Dua is also from Qadha and Qadr [2].
[1] Tawhid, Sheikh Sadooq, Page 337.
[2] Beharul Anwaar, Vol. 5, Page 78.
Source: en.shafaqna.com