Over time, I've realized I write my books in layers, like an onion, and from the outside, in.
My first draft is pretty much dialogue and, to use a theater term, blocking -- who moves where, when. This is when I figure out exactly what's going to happen to my characters. I also provide the character basics -- what they look like, how they sound, and their most basic motivations. This is the outer layer.
The subsequent layers, which require at least one more complete draft of the entire manuscript, and often several drafts of various scenes and chapters, involves adding physical details (clothes, furnishings, food), and -- more importantly -- delving more deeply into the characters' motivations and getting to the core of their internal conflict.
I've noticed that the first layer of conflict is usually quite specific to the setting; the deeper I go, the more universal the internal conflicts become.
For instance, in the book I'm writing now, the first layer of conflict is based on class. The hero is an outlaw, and the bastard son of a whore. The heroine is a noblewoman. Obviously, different social status, as well as the hero's law-breaking, is a hurdle. The heroine believes she shouldn't have feelings for a "bad guy." The hero has no particular admiration or respect for the nobility; that's why he has no problem stealing from them. However, he finds himself liking this particular noblewoman. What's up with that?
But let's go to the next layer:
Because of the hero's determination to help his brother, the heroine comes to appreciate that many times, she's put her own needs ahead of her family's. If she runs off with the hero, she'll be doing that again, with some potentially serious consequences for her family, too. This conflict now involves a woman's relationship with her family as well as the hero.
The hero's never murdered or raped, but honor has been something he told himself he couldn't afford -- until he meets the heroine, and sees himself through her eyes (or thinks he does). Now he wishes he could be honorable, to be worthy of her love. Given his past, however, to do that, he should leave her. This conflict is now about a man with a dubious past trying to do the right thing for the woman he loves.
Sometimes I know these deeper layers right from the get-go. More often than not, though, they come as I work on the book. It's like I have to get my characters on stage and talking before I can find out what really makes them tick.
This also means however, that I can still be adding another little layer to the onion even when I'm on the umpteenth draft. I may have read the same scene fifty times, and then, on read-through 51, I realize I can add a line or two that provides just that little bit extra about a character's past or motivation, and suddenly, I'm excited about the story all over again.
And that's my motivation.