Few films today are without music, and most of the time this music is programmed to the final product, the film is shot, edited and finalised before the composer does his/her part. So, the music is slotted in at all the right moments (if the composer does their job right).
However, before movies had sound, there were composers of a different sort, local organists that would play along with a film to add mood music as the film displayed on the screen. This sort of "in the moment" performance isn't one we tend to give much credence to any more, as it's been nearly a hundred years since we've needed this skill to accompany our films.
Fortunately, the skill hasn't been lost. In an article by Peter Hummers, of the Sentinel Staff, he writes about Dorothy Papadakos, a noted organist, who enjoys film-score improvisation. The beauty about this sort of performance is the live aspect of it; the performer is right there watching the film with us. As the mood shifts, so can the performer. Yes, there are elements of existing scores, bits that get used for their recognisably - Papadakos played Bach's "Toccata in D minor" to set the mood for Carl Laemmle's 1929 version Phantom of the Opera.
I have long marveled at jazz performers and their ability to improvise a piece, much in the same manner Bach or Liszt were famed for their ability to dance along the keys. But Ms Papadakos is even more amazing as she matches what she does with a film. That is truly a skill!