This case is slightly different. The laws are not related. However, selective enforcement of laws are made to encourage things to “go wrong” when certain acts are done.
After all, no body can, in a sense, prohibits anything. All we can do is to make things “go wrong” once in a while, when that thing is done.
1. Bob steal. Bob gets caught. Stealing is illegal. So things can go wrong if you steal. So there will be less thieves.
Notices that many thieves are of course not caught. However, the fact that things can go wrong for YOU when YOU steal discourage people from stealing.