An anachronism is before its time – usually in a bad way. It’s a thing that belongs to a period other than the one in which it exists or is attribed to. Usually we think of anachronisms as being misplaced. We think the author hasn’t done their homework. Unless they have been placed there on purpose for comic effect.
The Flinstones, for example, brought twentieth century issues into the lives of a Stone Age family.
But anachronisms are not suitable for serious historical novels.
Not all anachronisms are obvious. I don’t think anyone would make the mistake of having a character switch on a light in the Middle Ages. But would you know not to put a xylophone in an orchestra before 1874?
Anachronisms are not only wrong as actual things before their time, but also in similes and metaphors. As Chuck Sambuchino writes: “A fierce windstorm in a novel set in ancient Rome should not sound like an onrushing train.”
This is one reason why research is essential. And editing.