"Eye for an Eye" originates from the Code of Hammurabi and is found in the Old Testament books of Exodus and Leviticus. It is also referenced in the Sermon on the Mount by Jesus, found in the New Testament. Its meaning in the Bible was simply, the punishment or sentencing should equally match the crime.
From scripture,
Exodus 21:23-25 states, "But if there is harm, then you shall pay life for life, eye for eye, tooth for tooth, hand for hand, foot for foot, burn for burn, wound for wound, stripe for stripe."
Leviticus 24:19-21 echoes this assertion, "Anyone who injures their neighbor is to be injured in the same manner: fracture for fracture, eye for eye, tooth for tooth. The one who has inflicted the injury must suffer the same injury."