Music written for a play. Kind of like opera but with less singing (or none) and more talking than usual. Kind of like ballet, but with less dancing (or none) and more talking than usual. While many plays included a lot of music just as a given thing, the famous, non-anonymous (!) incidental scores usually came after the plays, sometimes long after, and are (have become) as self-standing as the plays they were written to accompany. You're more likely to hear incidental music in an ordinary concert than you are to hear ballet music or opera.
Beethoven, Egmont
Schubert, Rosamunde
Mendelssohn, A Midsummer Night's Dream
Bizet, L'arlesienne
Grieg, Peer Gynt
Those are the nineteenth century famous ones, (the ones Wikipedia has heard about), but there are many more, including
Sibelius, Tempest, Pelleas et Melisande
Nielsen, Aladdin
Prokofiev, Hamlet, Boris Godunov, Eugene Onegin
Shostakovich, Hamlet
And so forth.
Most definitions you can find online include any music written for t.v. shows, movies, video games and such. But aside from a few film scores, like Antheil's Ballet Mecanique, Prokofiev's Alexander Nevsky and Ivan the Terrible, and Bokanowski's L'Ange, these other kinds of "incidental music" are probably not going to be more than ephemeral.