The frequency with which this question arises demonstrates how well the concept is known but how little it is understood. Shiny and New does not make a home code compliant more than Ugly implies it is not. Building codes have a rich history dating back to the heyday of Babylon, circa 2000 B.C. Then, as with today, codes provide health and safety protection from known hazards, but it is essential to remember that there is context to this continually expanding document. The original Babylonian regulations may have protected residences from unscrupulous contractors but, in the end, proved meaningless when dealing with invading forces. I imagine all this proves is if one thing doesn’t get you, something else will.
Whether the specific codes your municipality follows are international, uniform, or some other building codes, they provide a consistent level of minimum building standards you can count on anywhere in the country. It is a living, breathing document subject to annual updates and regulation changes reflecting advancements in materials, products, social awareness, and our ever-changing lifestyles. I imagine confusion abounds because the codes are, by their nature, a moving target. It is important to understand code changes are not upgrade mandates. Generally speaking, new regulations are not retroactive but go into effect from the point in time they are adopted and subsequently into the future. This point of fact is more important if you own a home built around when the pilgrims landed at Plymouth Rock vs. a new build in a subdivision.
It would be naive to believe there is not a political or financial incentive to push for code changes. A new code mandate can significantly impact the corporate bottom line even if the advancement or new technology needs to work out bugs. To make this point clear, codes are not a mandate to upgrade. Existing conditions may remain until impacted by a rehab or extensive repair. This "Grandfather" feature prevents you from bing forced to comply with new requirements every time a code change occurs. Other factors will more than likely necessitate bringing your home into the 21st century. Your homeowner's insurance company may require a total home rewire to retain coverage; high heating bills may spur you to add insulation, but rest assured, a code inspector will not randomly show up to ensure your home is completely up-to-date.
Code-related issues usually arise when a home is passing from one owner to another, and if your home is 100% code-compliant today in a year or 2, not so much. The cost and impact of such changes can be expensive and impactful, especially when existing conditions meet your current needs. There are times when a new requirement is very logical and requires little thought. Smoke detectors were not required until 1976 but were so logical adoption was universal and rapid. Mandates that are so significant are rare, as most amount to tweaks of existing regulations. I advise using the codes as a guide and changing your thought process. Is the home code compliant, and does a code upgrade make sense for the home now?