In the 1870's Lev Nikolayevich Tolstoy (1828 - 1910) experienced a profound moral crisis. During the writing of Anna Karenina, he went through a personal metamorphosis from sensualist to ascetic. This had a dramatic effect on his literary output and the novels after Anna Karenina are of a different tone, and more didactic.
Writing Anna Karenina required many drafts over four years, and evolved from a rather superficial treatment of a 'fallen woman' to a more nuanced and sympathetic evocation of Anna, the literary heroine.
The novel accrued greater depth over those drafts. The constant in the concept was Anna herself, though her character changed in the early drafts. With Anna, Tolstoy was able to put his finger on his own flaw or failing; the sensualist. Writing Anna enabled him to see the flaw, name it and move past it.
1. A fast first draft and multiple successive drafts. (For this method ideally you need a sounding board - an agent...