If you read mystery fiction, there is always much about “motive.” Fictional detectives spend much time searching for that motive. Sometimes it’s easy to forget that “motive,” is equally important in non-mystery genres as well. It helps if you think of the term “logic,” rather than motive. When you build your story (and as a writer of fiction, building is what you are doing) you need to establish sufficient logic to enable your readers to understand, to follow why such-and-such happens. Surprises are great, but to pull the rabbit out of the hat, so to speak, at some time, you need to put the rabbit in the hat. Even fantasy must have its own logic and rules.
Just recently, when working on a new novel (a realistic novel) I realized I had not sufficiently established the logic for a key part of the action. This meant I had to go back to the start of the novel and rewrite so that the logic was embedded in the character and the story right from the beginning. Needless to say, this going back, meant rewriting so that the change became seamless with all that followed. In order to do this the writer must look at what he/she has written as a reader. It’s my old motto coming to my rescue: writers don’t write writing. They write reading.
As a famous (fictional) detective once said, “It’s elementary, my dear Watson.”
In fact, it is never elementary, but it must be clear.