Here is the story as I was told it...
1872(?) Great Chicago Fire. Got people thinking about inventing a building code.
1892(?) Columbian Exposition (Worlds' Fair), also in Chicago. Featured new thing called electricity. Had many fires. Insurance claims directly led to creation of UL, NFPA, NEC at the instigation of insurance underwriters.