What is "the Law"?
First, it's true that there's nothing that says the law has to be fair or just. There are many instances in history where it wasn't. There are still many instances today in the world where it isn't. And no system of law is ever perfect.
I think for the purpose of this answer, the simplest way to define the law is that it's boundaries.
Boundaries of what is legal and what isn't. Boundaries of which punishments are acceptable and which aren't. Boundaries on the law itself, like what can't be made illegal, or what punishment can't be enacted. Boundaries of how to interpret and adjudicate the law.
Those boundaries are an expression of moral and societal values at some point in time. Opinions of what should be legal and how to punish the rest, what should be a right, what should be an obligation, etc, it's the role of politics to translate those into policies, and it's the role of the legislative to translate those policies into laws.
In a democratic system, the law (ideally) reflects the sum of all our opinions and values on justice and fairness, rather than the opinion of a few tyrants.
What is "Justice"?
There is no definitive answer to that. Justice, fairness, that's a matter of opinion and morals. It's subjective. The difficulty of life in society is that we all have our own subjective opinion of what's just and fair, and that opinion changes over time.
As a practical institution however, justice is mostly about punishment and reparation. It is to be given after the fact, after something unjust happened. The role of the judiciary in that context is to decide on guilt, liability, punishment, and/or reparation in specific, individual cases.
There's nothing that says justice has to be fair and just either. There are many instances in history where it wasn't. There are still many instances today in the world where it isn't. And no justice system is ever perfect.
But in a democratic system, justice (ideally) makes its decision based of facts, evidence and well-defined laws, aims to find the truth, and balances the interests of society as a whole with that of the individuals.
Can justice exist independently of the law?
Not desirably, no.
Lawmakers have the power to define what is fair in the absolute. What is absolutely too far and not far enough, what values we hold for certain and can't be denied, etc. But ideas of due process, fair trial, proportionate punishment, those are moral values that were baked into the law. Law without that sense of justice would just be oppression.
Adjudicators have the power to define what is fair in a given individual case. They are presented the facts, the evidence, and they have to make a decision that will impact the life of the accused, accuser, and possibly society as a whole. But they can only operate within the bounds defined by law. Justice without that sense of the law would just be arbitrary.