From the days of newspaper TV Guides that would write
two sentence synopses (loglines) of a
television show. Sometimes these summaries wouldn't
sound comedic on the surface, so "hilarity ensues" was used to ensure the audience understood it was a premise for a comedy.