Indeed, there's an entirely separate, far more strict building code for apartments than for single-family detached housing.
This was an explicit goal of the designers of the early building code split: make single family homes as cheap as possible, and apartments as expensive as possible.
This was an explicit goal of the designers of the early building code split: make single family homes as cheap as possible, and apartments as expensive as possible.