“It was the experience of mystery - even if mixed with fear - that engendered religion.”
Mystery fiction is a loosely-defined term.
It is often used as a synonym for detective fiction or crime fiction—in other words a novel or short story in which a detective (either professional or amateur) investigates and solves a crime mystery. Sometimes mystery books are nonfictional. The term "mystery fiction" may sometimes be limited to the subset of detective stories in which the emphasis is on the puzzle/suspense element and its logical solution (cf. whodunit), as a contrast to hardboiled detective stories, which focus on action and gritty realism.
Although normally associated with the crime genre, the term "mystery fiction" may in certain situations refer to a completely different genre, where the focus is on supernatural or thriller mystery (the solution does not have to be logical, and even no crime is involved). This usage was common in the pulp magazines of the 1930s and 1940s, where titles such as Dime Mystery, Thrilling Mystery and Spicy Mystery offered what at the time were described as "weird menace" stories—supernatural horror in the vein of Grand Guignol. This contrasted with parallel titles of the same names which contained conventional hardboiled crime fiction. The first use of "mystery" in this sense was by Dime Mystery, which started out as an ordinary crime fiction magazine but switched to "weird menace" during the latter part of 1933.