Starting with Hammurabi, rulers have frequently appreciated that their subjects would be more acquiescent to being governed if they had at least a minimal appreciation that they were being treated fairly. That understanding has led to the development of law codes along the lines of the Roman Republic's laws of the Twelve Tables, which were inscribed in bronze and posted prominently in the Forum so everyone would know what the rules were. In the Middle Ages statues of Justice erected in the Italian republics often had her blindfolded and with a scale in one hand and a sword in the other, indicating that guilt would be weighed fairly and punishment, if merited, would be delivered inexorably. For modern democracies the rule of law has often been translated into the expression "equal justice under law."
Of course everyone knows that there is no such thing as equal justice. Certain infractions are rarely prosecuted while other crimes are pursued rigorously. Expensive lawyers reduce the risk of there being any serious consequences for the wealthy even when one is caught out. Employees of the state are rarely punished even when their felonies cost the taxpayers millions of dollars because no one wants to look closely at corruption in government.