There's a difference between codes, rules, and laws.
Breaking a law is illegal.
Breaking a rule is non-compliant.
Breaking a code is, well, that depends. The NEC, NFPA, etc., isn't going to send out the Code Police to arrest you if you violate one of their codes. On the other hand, if a state or municipality has adopted a certain code, then it becomes "law" in that jurisdiction. The building inspector can demand that you change something that does not conform to the code. The building inspector can also refuse to issue a certificate of occupancy if you put up a building or make a renovation that isn't compliant with the adopted codes. The real "enforcer", though, is your insurance company. They can choose to not pay your claim if you sustain a loss and the insurer can demonstrate that you didn't follow the adopted codes.
"Lightning struck your ungrounded 14 gauge THHN antenna wire and the resulting fire burned down your house? Ooh, sorry, we're denying your claim."
Or, worse yet, "Lightning struck your ungrounded 14 gauge THHN antenna wire that you strung across the fence to your neighbor's tree and the lightning energy exploded a tree limb that fell on your neighbor's house? Ooh, sorry, we're denying his liability claim against your home owners insurance. And, we won't defend you in court when your neighbor sues you."