Olenin, like Tolstoy himself, is a member of the Russian aristocracy....
The Cossacks, like other stories Tolstoy sets in the Caucasus and outlying areas of the Russian Empire, is both an examination of the culture of non-Russians living under the Czar and a critique of Russian culture and values.
Olenin, like Tolstoy himself, is a member of the Russian aristocracy. A recurring them in Tolstoy's work is the somewhat hypocritical attitude and behavior of Russian upper-class men, particularly regarding sexual matters. When the story opens, Olenin has apparently just broken off an affair, feeling somewhat guilty about it but also trying to rationalize his actions. In a change of setting, serving in the army in the Caucasus, Olenin hopes to get a fresh start on life. What he observes in the Cossacks is in many ways the opposite of the jaded and world-weary Russian upper-class culture of which he's been a part. First, the Cossacks are genuinely devout Christians. Though the behavior of Cossack men is wild and "uncivilized," Olenin perceives in them a type of honesty and directness and, above all, a quality authentically honorable, lacking among the self-satisfied and hedonistic Russians who, like himself, have been born to wealth.
As always, Tolstoy—in this case, through Olenin's eyes—observes much about the nature and the values of his women characters. Olenin, falling in love with the young girl Maryanka, sees an unspoiled quality and, perhaps because she appears to be indifferent to him, becomes more and more obsessed with her. It does not matter to him that her background is so totally different from his—or perhaps this is why he's so attracted to her. He's similar to Levin in Anna Karenina. Levin values one woman, Kitty, as his absolute ideal, but after she rejects his initial proposal and he's plunged into despair, he considers marrying a peasant woman instead. As other nineteenth-century writers do, Tolstoy tends to dichotomize women, granting a status of "purity" to some women and rejecting the rest. While Tolstoy himself might have seen beyond this simplistic and sexist formula, his characters like Levin and Olenin embrace it. In her purity and lack of guile, Maryanka represents a "higher" type of woman to Olenin, and she is thus the female analogue to the rugged, wild, and unsophisticated Cossack men whom Olenin implicitly judges as representing a culture superior, in its unspoiled state, to that of his own people.
In some sense the Chechens, though they're the enemies, have more in common with the Cossacks than either group has with the Russians. Though the judgment is muted in this story, Tolstoy, in spite of having spent years in the army himself, sees the Russian imperialist effort to take over the Chechens' land as morally wrong. Tolstoy is far more explicit on this point in his later novella Hadji Murat. In The Cossacks, when the Chechens find themselves doomed and begin to "sing their death song," it's clear that Tolstoy is sympathizing with them, despite the ruthlessness of the Chechens in their attacks on the Cossacks.
The conclusion of the story allows Olenin to see how much a stranger he still is to the Cossack culture. Maryanka wants no part of him, for what matters to her is only the tragedy that "Cossacks have been killed." The ethnic solidarity of the Cossacks, so much stronger than that of the Russians and of other European nationalities, completely destroys whatever hope Olenin has had of becoming united with Maryanka. And this, too, is emblematic of the distance overall between the Cossacks and Russians. Though Cossacks and Russians are allies in the frontier war, the Cossacks see the Russians as alien and wish to preserve their own insular, independent culture.