system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why do accidental notes in music have word accident in them?
gpt
In old-school philosophy things were described as having an *essential nature*.  Objects behaved according to their essential nature - rocks fell downwards, smoke rose upward, dogs barked, water flowed, old men were grumpy, and so on.

Anything that happened that was contradictory to something's essential nature was *accidental*.  So if you threw a rock upwards, that was accidental motion of the rock.  If you dammed a river to stop it from flowing, that was accidental motion of the water.  Make an old man happy, that was an accidental mood, and so on.

Expanding that into music, the key signature at the start of the piece sets the "essential nature" of the notes.  If there are notes that go against this essential nature, that have to be marked with their own sharps or flats, those are accidental notes.