I think, perhaps, many difficult child's do understand the law (intellectually, that is). In fact, I suspect they may know more about it in some ways (intellectually), than we do.
I think, however, that many (esp with certain diagnosis's -- Personality Disorders, in particular) may not "understand" the law (or consequences) in the same deep and meaningful way others do. They only understand the logical aspects. They don't grasp the deeper, ethical aspects. They are sometimes (not always) literally "blind" to seeing consequences.
I once asked my son if he had any "Inner Stop Sign". To which, he replied, "No." I think some are either born without an Inner Stop Sign (disease), have theirs buried deeply and largely inaccessibly by environment (trauma, drugs, etc), or choose to bury it deeply for whatever reason.
My Inner Stop Sign guides my life every day -- whether tangibly, ethically, or metaphorically. Our difficult child? Not so much.
I truly have no Inner GPS (which I hear they just discovered there's a physical location in the human brain which acts as one). Well, ok, maybe I have one but it's atrophied! LOL!
Perhaps (just speculating out loud here)..........just as I have no Inner GPS, some of our difficult child's have no Inner Stop Sign?