"Vengeance is mine; I will repay, saith the Lord." – Romans 12:19
There are two ways we can try to get at this epigraph: the first is to think about revenge in the novel. The subject of revenge doesn't occupy too many pages (relatively speaking) in Anna Karenina. Why does Tolstoy use the epigraph to point us in the direction of revenge when he barely talks about it in the novel?
Revenge first surfaces in Part 4, Chapter 17 of the novel, when Karenin receives Vronsky in his study following Anna's illness. Karenin admits that after finding out about Anna's affair, he was consumed by a desire for revenge, a desire to make Anna suffer. Following this confession, however, Karenin switches gears. He says he has completely forgiven Anna. He then references the Bible, claiming that he's turned the other cheek (a reference to the Gospel of Matthew), and that he's prepared to forgive.
Karenin's Biblical reference leads us back to the beginning of the book, to the message that Tolstoy wants us to take away from the epigraph. When taken together, Karenin's peaceful reference to the Gospel of Matthew and the epigraph to the novel clarify that for Tolstoy, wrongdoing should never bring about vengeance.
But we mentioned that there's a second way we can read the epigraph: the word "vengeance" is almost like a red herring. This novel is really about the opposite of revenge, which (again, for Tolstoy) is man's humility before God's judgment. Consider the larger context of the quote in the Bible, Romans 12:19:
Dearly beloved, avenge not yourselves, but rather give place unto wrath; for it is written, Vengeance is mine; I will repay, saith the Lord.
In other words, don't worry about taking revenge in this lifetime: two wrongs will never make a right. Tolstoy is Christian in his morality here: no matter how guilty he finds Anna Karenina (and Tolstoy does not approve of adultery), it's not for us to condemn her. In his opinion, that's God's job. This novel isn't going to punish Anna (though some might say that throwing yourself under a train is a pretty big punishment), it's just going to explore what makes her tick.
And that's what makes Anna Karenina a psychological novel rather than a morality play or a parable: Tolstoy wants to work out what makes a "sinner" like Anna do what she does. In order to avoid her shortcomings, we must first understand them. And like Karenin, and eventually Anna herself ("Lord, forgive me for everything!" [8.31.21]), Tolstoy seems to believe that Anna will get whatever is coming to her only after her suicide, once she reaches the realm of God's judgment. Even though Tolstoy is the one writing her character, he's saying that Anna Karenina's real fate isn't on the pages of the novel. What will actually matter is what happens to her (or other women like her) once she is judged by God.