A mystery is a whodunit. You know what happened, but not how or who's behind it. A thriller, or a suspense, is a howdunit. You know what happened, and you usually know who did it, but you keep reading because you want to know how they pulled it off.
M. J. Rose