In America, operettas after the Austrian styles were popular from 1870 through the early 20th Century. But by the 1920's, their popularity waned due to the influence of jazz. Musical comedies then became popular. This is not to say that all musical theater was light-hearted romantic comedy. Some shows have very serious themes even though they contain humorous moments. (Think "South Pacific" or "West Side Story.")
Over time, many conventions have become standard. These include production numbers (using most of the cast), solo songs that clue the audience into the thoughts and motivations of the main characters, small ensemble songs that explore dramatic situations and move the plot along, songs purely for comic relief, and then the (all important) love duet. Critical to the success of the show are the REPRISES --- songs that are repeated near the end, sometimes with slight lyric changes --- that keep the songs alive in the minds of the audience members.
I was taught that if the audience doesn't go out singing or whistling the tunes, the composer didn't do his job.
And that is precisely my gripe today.
I confess that I have been especially disappointed in some of the recent movie musicals meant for kids that are not so musically kid-friendly. I may have been motivated to go out of the theater dancing to the rhythms of the music, but I had trouble recalling any complete tunes or even much of a refrain. I sure hope this trend won't continue forever!