II Maccabees somewhat hints at a doctrine of substitutionary atonement, in which a righteous person endures God's wrath in place of sinners. And IV Maccabees explicitly states it.
In II Maccabees, God punishes Israel for adopting Greek customs (II Maccabees 4:11-17). That's why Antiochus Epiphanes violently enters Jerusalem, desecrates the temple, imposes the death penalty for Sabbath-observance and circumcision, forces Jews to eat pork, and kills a bunch of Israelites. Antiochus is God's punishment!
But there are martyrs who stand by God in the midst of Antiochus' persecution. In II Maccabees 7, a mother and her seven sons die rather than eating the king's pork. The last son boldly says to King Antiochus:
"I, like my brothers, give up body and life for the laws of our ancestors, appealing to God to show mercy soon to our nation and by trials and plagues to make you confess that he alone is God, and through me and my brothers to bring to an end the wrath of the Almighty that has justly fallen on our whole nation" (NRSV).
The son thought that his death would appease God's wrath and influence God to show mercy on his nation.
IV Maccabees is explicit about the blood of the martyrs bringing atonement for the holy land:
1:11: "All people, even their torturers, marveled at their courage and endurance, and they became the cause of the downfall of tyranny over their nation. By their endurance they conquered the tyrant, and thus their native land was purified through them."
6:28-29: "Be merciful to your people, and let our punishment suffice for them. Make my blood their purification, and take my life in exchange for theirs."
17:9-10: "Here lie buried an aged priest and an aged woman and seven sons, because of the violence of the tyrant who wished to destroy the way of life of the Hebrews. They vindicated their nation, looking to God and enduring torture even to death."
17:20-22: "These, then, who have been consecrated for the sake of God, are honored, not only with this honor, but also by the fact that because of them our enemies did not rule over our nation, the tyrant was punished, and the homeland purified-- they having become, as it were, a ransom for the sin of our nation. And through the blood of those devout ones and their death as an atoning sacrifice, divine Providence preserved Israel that previously had been mistreated."
The martyrs appeased God through their stand for God's law. That's why God then assisted the Maccabees in their fight against the tyrant Antiochus.
I have mixed feelings about this motif in Maccabees:
1. One quote that comes to my mind is something Charlton Heston said on the Ten Commandments: "Does this God require a bruised back as a sign of his service?" (I know I'm leaving something out!) Here God is in II and IV Maccabees, punishing the Israelites for their sins. Then he's finally happy when a select group gets martyred for his laws.
I don't really have a problem with the vicarious atonement in Christianity, since, in that case, God proactively sends his Son to die for the sins of the world. There, God actively pursues reconciliation. In the Maccabean scenario, by contrast, it seems like God just sits around waiting to be impressed.
2. How sad it is that the righteous must suffer for the sins of the wicked. God was punishing Israel for adopting Greek customs and forsaking the Torah, but the ones who suffered the most were those who were faithful to God. I guess that the Hellenizing priest, Jason, suffered when Antiochus found out about the revolt he was leading (II Maccabees 5), but, overall, those who went with the flow and abandoned the Torah didn't experience much pain at the hands of Antiochus. It reminds me of those who claim that God sent the Holocaust to punish the Jews for Reform Judaism, which they think compromises God's Torah. If that were true, then why did so many Orthodox Jews suffer at the hands of Adolf Hitler?
3. At the same time, there's something inspiring about people triumphing over their enemies through something other than the force of arms. The martyrs displayed conviction to the awe of their enemies, and they won over a God who actually cared about what his nation did. God may have been waiting to see if there was something redemptive about his nation--a sign that someone cared about his laws and his covenant. When the martyrs died for their faith, God realized that he could work with his people. Not all was lost! They hadn't totally forsaken him. On the basis of these few martyrs, he could work with an entire nation.