Justice is grounded in a certain equality, that is giving what is due according to a nature. There is an equality between the nature and what is owed it and what is given. This equality establishes justice.
In retributive justice, there is not a clear mathematical equality. A murderer may be punished by execution or years in prison. A murderer may get 30 years and this may be just. However, 30 years plus or minus one minute is not unjust and it is certainly within the realm of good judgement that plus or minus 10 years may still be just.
Yet, we recognize that the “punishment should fit the crime,” that is there should be a proportionality between between the crime and the punishment or a crime is due a degree of punishment consistent with the nature of the crime. Execution for a white lie is certainly unjust and two hours in a holding cell for murderer as well or even a fine of $5.
Similarly when we consider an exchange. There is not a mathematical equality of price that establishes justice, where more or less is unjust. A dollar for a loaf of bread may be just, but 99 cents or $1.01 is not unjust.
However, there must be a sort of proportionality between what is given and received in the objective worth to men (or economic value) of each. There are certainly instances where this goes astray, but there is a certain equality that is reached in exchange.
Considered individually, we may speak of each benefiting from the exchange and indeed neither would engage in the exchange if they did not benefit from it. However, taken together we achieve a certain equality. Alvin desires B more than A and Bob desires A more than B. Between them there is a certain “intersection” of desire of the objects that establishes a sort of equality or proportionality. While both individually benefit from the exchange, the exchange taken as a whole indicates the worth of A in terms of B or B in terms of A.
One certainty about this is that justice presumes a correct estimation of the objective value of the object and thus well ordered desire. There may be an “intersection” of desire where the desire is disordered, but justice cannot be established upon error and evil.