The idea was that it was a legal code presented by Hammurabi to his kingdom, which emphasized the importance of doing justice and paying damage. Interestingly enough, Hammurabi's idea of justice - often compared with Exodus 21-23 and not unlike it - is still a bit more strict than the idea of "an eye for an eye". Hammurabi's code uses the death penalty as a deterant from all sorts of crimes, which makes the book of Exodus seem quite liberal in comparison.