Why would you pray for someone who died? Isnt their fates sealed?
Are you aware that when your body dies, your soul is alive and goes through a particular judgment by Jesus Christ, himself?
Then the alive soul is either judged for heaven, Purgatory or hell.
So we pray for them, and they know we are praying for them.