I guess there are several reasons why readers gravitate toward mysteries. There was some discussion of this recently among members of a writers group I belong to, Sisters In Crime, and the consensus really went along with all the reasons I've personally found the mystery genre so satisfying and fun to read.
1. Mysteries give us the sense that justice prevails. A crime happens, the sleuth follows the clues, the bad guys are caught and put away. Since real life often doesn't give us that satisfaction, finding resolution in fiction meets one of our basic needs.
2. Mystery readers love series. Unlike many other fiction genres, with mysteries we get to stay with a set of characters we like. Sometimes it's a location that appeals to us. Often the protagonist's profession is one that we find interesting. As we get to know those fictional folks and learn more about them, we develop a bond. Multiple literary agents over the years told me that I should drop Charlie after the first few books and start writing something new. But when I talked to readers they were appalled. They wanted Charlie and Drake and the whole gang to stick around. Well, guess who was more important to me?---My readers!
3. Readers often look for the bits of the story that come from the author's life. Many authors draw from their own experiences in creating their fictional worlds--be it the police department, the hospital, the courtroom or some other career. In my case, the whole world of helicopter operations comes out of my own life. My husband is that handsome helicopter pilot and his work inspired many of the situations in my books.
A lot of my own work experience before I began writing full-time was in accounting, so it was a natural to use that as Charlie's profession. At an earlier point in my life I decorated cakes and sold them for extra spending money--that became the basis for Samantha Sweet's career in my new series (okay, that and my obsessive love of all things chocolate!).
Now that you know which parts are real, I guess I need to state for the record that there are many parts of the books that are completely made up. I've never fired a gun at a person; I've never seen an up-close dead body that wasn't first prepped by a funeral home; I've never been brave enough to go chasing down bad guys. Probably at least 80% of Charlie's adventures come right out of my head.
But maybe that brings us to another thing readers love about mysteries. We get to live a lot of those outside-the-box experiences without really having to put our own necks on the line.