They do not. I have studied philosophy my whole life, graduated from Harvard Law School, did trial work for 25 years, and wrote the book “An Existential Philosophy of Law”. They are complete opposites. Philosophy rationally seeks knowledge of the fundamental nature of knowledge, reality, and existence. Law is the rationale by which the few in power stay in power over the many powerless through a monopoly on violence unconcerned with the fundamental nature of anything except what it needs to maintain the status quo of power — neither knowledge of truth or falsity, reality, nor any existential concerns other than a need to create a world in the image of each individual judge or politician law giver or enforcer who makes law to protect their power. Reason in law is used only to create and generate verbiage to hide law’s nature and the divide between what “is” and what “ought” to be. This is true regardless of whether the judge or other lawgiver is conservative, liberal, or whatever, regardless of whether it is Stalinist Russian law, North Korean law, Western law, or whatever; a judge in any one of these will just as easily become a judge in any other one of these cultures of law if need be. They all have the same Will to Power: to judge others’ lives and to enforce execution of that judgment upon others’ lives so as to maintain the power of law.
Unfortunately, this divide is an unavoidable part of reality. In our reality, there is no way rationally to get from what “is” to what “ought” to be. Therefore, fate, destiny, luck, God, or whatever you want to call the reason for there being something instead of nothing hates the poor so much that reality is designed so that a chosen few will always be able to force their vision of what “ought” to be on the remainder of society. Philosophy can make you a good, honest lawyer but not an ethical, respected lawyer. In the world of the blind, a one-eyed man is not king but a danger that must be eliminated.
As George Orwell said in 1984:
Throughout recorded time, and probably since the end of the Neolithic Age, there have been three kinds of people in the world, the High, the Middle, and the Low. They have been subdivided in many ways, they have borne countless different names, and their relative numbers, as well as their attitude towards one another, have varied from age to age: but the essential structure of society has never altered. Even after enormous upheavals and seemingly irrevocable changes, the same pattern has always reasserted itself, just as a gyroscope will always return to equilibrium, however far it is pushed one way or the other.
There are few philosophers who respect law as a serious academic study, most consider it essentially a trade school for politicians. There are few lawyers who respect philosophy; most consider it wasted ivory tower thought. I learned too late they are all right. Do not be fooled by verbiage that says nothing but serves only to hide the above reality — examples of which are in the other answers to your question.