Allah has two types of wills: the contingent and the fixed. The fixed does not change. Nothing can change it. The contingent can be changed. Let’s say that a person is decreed to die at age 30 based on his circumstances and the factors surrounding him. If he does a good deed or supplicates, Allah will change those factors so that he can live another 30 years. In this example, supplication changed this decree. But if the person had not supplicated, he would have died at 30. Now obviously Allah knows what this person will do, since Allah is outside of time and He sees everything at once, but in the end, the idea here is that the person played a role in his fate. His deeds played a role in how long he lived. This motivates us to always do good.