The word “mystery” and its cousin “mystic” both trace back to Latin and Greek words (mysterium and mysteria) for secrets, especially religious rites performed by secret orders. The Greek root myein means “to close” or “to shut.”
Even in English, “mystery” was first used in a theological context, referring to divine revelations and mystical truths, but it was quickly extended to refer to any sort of secrets or hidden thing.
Stories with mysterious circumstances, dark crimes and surprising twists have of course existed for centuries, but the typical mystery genre structure and plot arose in the early 1800s. At that time, they were typically called detective stories—the term mystery didn’t become the name of the genre until 1908.
Edgar Allan Poe’s 1841 short story The Murders in the Rue Morgue is often cited as the first true work of modern detective or mystery fiction in the English language. Poe himself called it a story of “ratiocination,” which means a story of reasoning.
One reason that mystery fiction was rare or unusual before the 1800s was that most police forces were smaller, and advanced crime solving was either immediate or, if they lacked information and resources, just didn’t happen.
But urbanization and industrialization concentrated populations, which yielded more robust law enforcement including inspectors and detectives, whose work captured the imagination of the public and led to both true crime and the mystery genre and its derivatives.