We've all been apprehensive watching a very dramatic scene in a movie or tv drama. If the scene has music then the role of that music is to embellish and enhance the drama unfolding before our eyes. Most of the time we're not even aware of that music. That's what the composer and director want. The music is like a "fourth dimension" that further triggers our emotions. You only need to watch that scene with and without the sound to see how music influences the impact of the mood of the scene. Composers go to a lot of trouble to make sure that the viewer doesn't notice their work. Good drama music should be " seen and not heard".
Back in the days of the silent movies a pianist or organist was given some sheet music as accompaniment for the film that was screening. Bigger budget productions allowed some cinemas to employ a small orchestra. The score was sent to the various theaters along with the film print. As the movie industry evolved so did the way music was used. The advent of sound recording was a clever way movie producers and exhibitors could save the money that was spent on employing live musicians. Instead of a written score being sent out with the film, now it was a recording of the musical accompaniment, which was played at the required moments by the projectionist or the assistant.