This is an act of respect for the deceased. Yizkor is the ancient custom of recalling the souls of the departed and contributing to charity in their memory. It is rooted in the fundamental Jewish belief in the eternity of the soul. When physical life ends, only the body dies, but the soul ascends to the realm of the spirit where it regularly attains higher levels of purity and holiness. But there is a way that the disembodied soul can derive new sources of merit.
History is a continuum.
If we, the living, give charity or do good deeds due to the lasting influence or in memory of a departed parent or other loved one, the merit is truly that of the soul in its spiritual realm. Moreover, God in His mercy credits our deed to the departed one because he or she too would have done the same were it possible. Even if the departed one was too poor to have made contributions to charity, the soul benefits nonetheless, because it may be assumed that he or she would have been charitable had sufficient means been available. A Yizkor service is not attended by those whose parents are both living.