Prayer in these situations is more for us and the grieving parties than actually effectual for change.
Even when we do receive “answers to prayer”, or what we interpret as such, there is very little way, other than by faith that they are in fact divinely provided. We have faith that they are and for most, that’s enough for them to believe that they are.
The comfort and peace of knowing someone is there caring for you and with you. Human kindness and empathy in action.
For all that prayer does not accomplish in regards to traceable divine intervention on our behalf, the act and effort changes us and those around us as we empathize with them. That is the true impact and effect of prayer, even when God says No or Wait or just Nothing.