For owner-builders there was a series of homeowners insurance claim denials in the 1990s and 2000s because unpermitted work was observed by the adjuster. This resulted in the former occupant simply abandoned the house, leaving a subpar structure, contributing to blight, and lower property values. The city building department made very easy and inexpensive for these people and to get a permit. For minor work, $30 out the door and for major work $87 (assuming you don’t get the discount). This fee includes two free inspections (pre and final) from professionals at the building department, usually same day.
I bought a fixer-upper in 2017, did a full rewire, repiped water supply lines, gas to electric range conversion, trenched 30ft to my detached garage (for 240V/125A power, data, and water), and installed a mini split system. They got to know me well and just instructed me to do a video walk through as they did not have any problems with my work prior. This was only possible because they care more about public safety than fines.
One theory I have is that policy dictates that they cannot issue a fine right away, they must leave a notice of some sort that they owner must respond to (usually by getting a permit, sometimes by arguing it’s not required) or will face a fine. They just cut out the junk in between by helping them the permit right there, which ends up being a good enough experience that most people just get the permit next time.