Like demented toys, demon children, and spooky nursery rhymes, an evil, murderous, or otherwise scary clown has become a common trope within horror. And like the others, it is a subversion of what is expected. Which in some ways creates the desired horror. Clowns are supposed to cause joy. So when it suddenly has a giant knife or razor-sharp teeth, the effect is both jarring and effective.
Although books like IT and movies like Poltergeist helped solidify this scary clown trope, there are examples of devilish clowns in such works as Edgar Allan Poe’s Hop-Frog (1849) and Ruggero Leoncavallo’s Pagliacci (1892).