Why do we pay for the dead? It is true that the dead are judged by how they lived. Generally, the Church teaches our future in eternity is based on our faith, life, deeds, virtues, love, compassion and goodness (or their absence) in this life, before our death. Yet, since we are never fully sure of the place of each soul before God, and because God Himself is merciful and loving, we pray for any help which might come to the soul of the deceased.
The Church teaches that our prayers help the deceased in some way. We do not know how or how much. There is an interesting passage in 2 Maccabees which addresses this question. Some soldiers of Judus Maccabees, the Jewish leader, fell in battle and were found to have idols on their persons, a grave sin. Their death was blamed on their sin (12:42), A collection was taken for funds to be sent to the temple “to provide for a sin offering” (12:43). The book comments on this by connecting this act with the resurrection. “For if he were not expecting that those who had fallen would rise again, it would have been superfluous and foolish to pray for the dead. But if he was looking to the splendid reward that is laid up for those who fall asleep in godliness, it was a holy and pious thought. Therefore, he made atonement for the dead, that they might be delivered from their sin” (2 Maccabees 12:44-45). These words were written about 50 years before the birth of Christ.
The Orthodox Church: 455 Questions & Answers, S. Harakas