Because they have to be caught. If no-one catches them, if no-one reports it, if no-one believes it they can get away with it.
Also they know its wrong so often they scare children into not telling. Because all children need their parents to love them even if they've done awful things often children are too scared to tell. Too scared they might get hurt more, too scared their parent will get in trouble, too scared they might get taken away.
it is against the law, but only a few parents get caught and get taken to jail. But even if they didn't get caught it is still wrong, it is still against the law, they are still not allowed to do that.
An it is a really good thing to think about and do things that make you happy.