Du’a has the capacity to change that which is written. There are two types of destines (ajals): the fixed and the contingent. A lot of it is contingent—it depends on your actions and Duas. Let’s say Allah’s will is for your mother to pass away next year due to cancer. But if she does Dua, Allah postpones that and prolongs her life. So everything is written by Allah, and part of what He has written is for you to have free will and choose some aspects of your destiny.