The existence of the law is one thing; it's merit and demerit another. Whether it be or be not is one enquiry; whether it be or be not conformable to an assumed standard is a different enquiry.
These are words of John Austin, who is considered to be the founder of a philosophy of law called "legal positivism." He was a contemporary of Jeremy Bentham. J.S. Mill attended his lectures on law.
A legal positivist maintains that the law is something that exists regardless of whether it's good or bad. It is something different and separate from what's described as natural law. When we study the law as a functioning system, therefore, it's specious to contend, as people too often do, that it isn't really the law because it doesn't meet a particular moral standard, whether that standard be natural law, the commandments of God, or some other standard by which right and wrong, good and bad may be determined.
According to the legal positivist, it's incorrect, therefore, to claim that a law considered wrong or bad according to some such standard isn't a law. It's a law alright. It may be a bad one. We may claim it should be changed, or shouldn't be followed, but a law it is and so it shall remain until changed or revoked.
There are those who have difficulty accepting this view. They appear to believe that the law must be something else; something higher, something that's just, fair, equitable. A law must comport with natural law, and recognize and uphold natural rights. The law according to their point of view isn't the law we humans and our governments may adopt, promulgate and enforce. The real, true law is otherwise there in some respect, written in the stars as it were, or existing in the mind of God.
The proponents of the American and French Revolution were given to maintaining that the laws they objected to were contrary to natural law and/or natural rights, which were superior to the law imposed by those they rebelled against. Thus, they were not appropriately law under this conception. Not being law, there was no obligation to follow them and even a positive duty to defy them. This apparently was felt necessary to justify rebellion. It may be it was believed that characterizing them in this fashion created more of a foundation for revolution then characterizing them as merely bad, unjust laws. A tyrant's laws are more evil if they constitute a violation of the laws of God or Nature than if they only seem bad to other, fallible, humans.
Perhaps this was an understandable view when it was claimed that kings ruled by divine right and governmental authority could not be challenged without being dramatically unjust. Those times are gone, though. When man is the measure of all things, appeals to an unwritten law are unavailing, or at least unconvincing.
Some people tend to believe that the acceptance of legal positivism requires that we believe all laws, all systems of law, are the same in merit, and that any law must be obeyed. That's not something that follows from the premise that bad laws are laws nonetheless. It's a conclusion which in its own way is derived from the belief that the only real law is that of nature or nature's God. In that case, of course, the laws must be obeyed. Interestingly, those who don't accept legal positivism will also tend to be those who claim that laws they find objectionable need not be followed. In that case the law is merely a human contrivance which may be violated, when it serves to protect, for example, rights we believe don't exist, laws which protect people we don't believe should be protected, or laws which allow conduct we believe should be eradicated instead of protected.
Legal positivism imposes a most useful distinction. That distinction is between the existence of the law and its worth, or merit. Knowing what a law is, why it was adopted, how it functions in a legal system, is far more useful in determining whether it should or should not be changed than some effort at deduction from assumed standards, especially those that are supposed to be embodied in nature or exist in the mind of God.