Electrical rules and regs are the province of the local town hall. There are layers on top of that at the state and federal level, but most of it comes at a very local level. What you can do in this town, may or may not be what you can do (get away with) in the next town. Because of this, you can see some really odd stuff.
In my limited experience (pulling permits and rewiring my own house during a renovation), wiring codes are based on the NEC (National Electrical Code), with major revisions published about every three years if memory serves), which is supposed to by and large set minimum standards.
Just to amplify for our international forum members, it's worth explaining the US system, which might seem strange to them. Our government is federated. That word actually means something, with both good and bad implications. To a first approximation, it means that the federal government can't do things that it isn't specifically allowed to do under the constitution. And yeah, building codes fall in that category.
There is no national building code.
The National Electric Code (NEC) is not a law, but a document created and maintained by the National Fire Protection Association, a private nonprofit organization. What gives the NEC the force of law is that governments that have appropriate jurisdiction (states, counties, cities) adopt it. As of now, the NEC is law in all 50 states having been adopted by /their/ legislatures. Furthermore, counties and cities can add their own stuff. Note, however, that given that the states have adopted it as law, a local government cannot UN-adopt the NEC. Sh*t flows downhill, as it were.
In actuality, the federal government does often find ways to force its way even when it does not have strict jurisdiction. For example, they can withhold related or unrelated funding. They did this with the national speed limit. The feds had no right to set a national speed limit, so they instead said "ye shall set your speed limit at 55 lest we withdraw highway funding." Sometimes these carrot and stick approaches are challenged in the courts, and outcomes have gone both ways. In this case, it stuck, but eventually was repealed in 1995 through the normal political process.
Someone brought up insurance. I think this is also a major unifying factor in setting codes, and probably has more influence than the federal government in such matters. If they won't insure it, you probably won't want to build it.
I personally have mixed feelings about the NEC. On the face, it's almost certainly a very good thing overall, having saved many a structure from destruction. However, it grows every three years, and I strongly suspect they are chasing smaller and smaller returns (in terms of avoided fires) with ever more expensive interventions (like AFCI). The organizations most likely to show up to meetings (and to be on the board) to advocate for something new are: electricians, manufacturers, fire departments, and insurance companies -- all of which are in a position to suggest new expensive interventions and shift the costs of same onto someone else (builders, homeowners).