Film music has been around longer than film dialogue. In the early days of cinema, the technology did not permit an audio track to accompany visual images when movies were shown in theaters. But the films did have music, in the form of live instrumentalists performing inside the theater itself.
When engineers managed to add an audio track to film reels, the audiences could hear the dialogue for the first time—but the music didn’t go away. It simply transferred, gradually at first, from a live performance in the theater to a recorded performance incorporated into the visual imagery. Suddenly, music was no longer the purview of the live instrumentalists in the theater. It was controlled by a person on the film production team: the film composer.