Early sources of this classical principle of justice are the Law Tablets of King Hammurabi (1760 BC) and the Torah (Exodus 21:23-27, Deuteronomy 19:17-21). The principle is called Lex Talionis ("measure for measure") It might have originated from a need to temper a common tendency of the people to execute too severe punishments, thereby causing instability. Lex Talionis differs in form throughout a long history. Early on, the practice of recording prescribed punishments for specific crimes developed. Among other variants, there is also the principle of the "mirror punishment", which is more in the spirit of the original idea. That is
Also Called "retributive justice" - to punish the offender in proportion to the amount of harm caused by the offense. The offender can also, in another version of "retributive justice", be punished in proportion to the amount of unfair advantage that he has gained by the offense. Much more can be said about this. What matters for this essay is that the concept of "Eye for an eye" is in the roots of the law systems – and in most peoples general perceptions on justice – in the western world until this day.
What also matters for this essay is that although the concept might seem almost omnipresent, it is a human idea, not a cosmic law.
aleister crowley shows this clearly, when discussing Karma:
"The idea of Karma has been confused by many who ought to have known better, including the Buddha, with the idea of poetic justice and of retribution;" "...Karma does not act in this tit-for-tat way. An eye for an eye is a sort of savage justice, and the idea of justice in our human sense is quite foreign to the
Constitution of the Universe. Karma is the Law of Cause and Effect. There is no proportion in it?s operations. Once an accident occurs it is impossible to say what may happen; and the Universe is one stupendous accident; If we eat too much salmon we get indigestion and perhaps nightmare. It is silly to suppose that a time will come when a salmon will eat us, and find us disagree."
Books in PDF format to read:
Rabbi Michael Laitman - The Kabbalah ExperienceAnonymous - Wicca Beliefs And PracticesAlice Bailey - Telepathy And The Etheric VehicleMoses Maimonides - The Guide For The Perplexed