there is a common practice to learn torah for someone who is deceased 'l'iluy nishmato/a' - to raise her/his soul. There is also a common (american/ashkenazik?) custom for a relative of a deceased person to provide food and drink to others on the yartzeit of the deceased. Before making a blessing on the food and drink (or sometimes after) people will say "the neshama should have an aliya".
I would like to understand the mechanics of what is happening here. presumably the miztvot that are being done accrue some sort of merit for the deceased person. Is this correct?
I also assume that these merits cause the neshama to become closer to God which is what is implied by 'having an aliya'. How is this understood; especially in light of the Rambam's statement that a person's closeness to God is directly proportionate to the person's intellectual grasp of God