Interesting anecdote that I am not entirely sure is true, is that “classical music” genre got its name because music was the only art that we didn’t know how it was in Ancient Greece and Rome, where the term “classic” is usually applied to.
So, by the time people were rediscovering the music of Bach and that type of music was growing in popularity, people decided to use “classical” for that sort of music.