"You have heard that it was said, 'An eye for an eye and a tooth for a tooth.' But I say to you, Do not resist an evildoer. But if anyone strikes you on the right cheek, turn the other also; and if anyone wants to sue you and take your coat, give your cloak as well; and if anyone forces you to go one mile, go also the second mile. Give to everyone who begs from you, and do not refuse anyone who wants to borrow from you." (Matthew 5:38-42)
Jesus starts by alluding to Deuteronomy 19:21 and 21:24. In its earliest context, "an eye for an eye and a tooth for a tooth" reined in revenge. It forbade exacting vengeance beyond the hurt one suffered. The concept continues to influence us today, being the core principle upon which most western concepts of justice rest.
That being said, the saying also often lends a tone of legitimacy to those who want revenge. Left unchallenged or unmodified, "an eye for an eye and a tooth for a tooth" may (and does) fuel endless cycles of retaliation. It may restrict the scope of violence, but it cannot end violence.
Jesus calls for a kind of nonviolent resistance. His examples are drawn from his historical context. Striking someone on the right cheek with the back of one's right hand was a well-known way to insult another. It invited a similar response. Jesus called his followers to refuse to play the game. In similar fashion, an opponent might take advantage of his power or a corrupt justice system to take one's inner garment. If so, confound them by giving up one's outer cloak as well. A Roman soldier might legally compel one to carry his military equipment for a mile. Jesus instructed his followers to go an extra mile willingly. His focus in is on actions taken. Break the patterns of violence and resentment. Go beyond what the law or custom require. To put it mildly, his words probably did not set well with the majority of an occupied population.
The final injunction to give and lend to all who ask does not fit easily with the preceding verses. Had I been editing the materials that became Matthew's Gospel, I probably would have placed the verse in chapter 6, perhaps in the vicinity of verses 2 and 3. Still, I think it fair to say that Matthew links the saying to the previous ones because of their shared extremeness.
Following the way of Jesus is risky by normal standards. At best, your reputation may well be called into question. You'll certainly frustrate friends and fellow "tribe" members, when you refuse to respond to violence with violence. You may wind up broke (the nightmare of most western Christians)! Your time may be consumed. Certainly, you may suffer physical harm, and perhaps even death.
Jesus operates out of a vision: the cycle of violence and self-protectiveness can only be broken if we refuse to play by its rules. He clearly believes he speaks for God in this matter.
I think it best not to seek to explain away Jesus' radical position. His followers may choose other responses to violence, but I believe when we do so we should acknowledge we have departed from the strict way of Jesus.