According to Freud the unconscious basis of the concept of justice is the idea: “What I am not permitted to do, no one else should be permitted, either”
There is a relationship between justice and symmetry. “It is fair that what happened to the right must happen to the left.” “Symmetry is achieved if what happened to a child happens to the other brothers and sisters as well.”
Otto Fenichel. The Psychoanalytic Theory of Neurosis, 1946.