How well do you know your characters? You created them, but there's a lot of discovery when it comes to your creations. I feel like writers, as artists, have their art "come alive" more than any other. We ascribe certain personalities and traits to these people, created or historically inspired. And the things they do sometimes surprise us.
Have you ever been writing a scene, write in some detail, and then your character reacted in a way you didn't anticipate? Just, in your head, you know in that moment that even though you planned these actions, they're wrong for who this character has turned out to be?
Congratulations! You've discovered something new about your characters that you didn't know before. But don't let it ruin your grand plans. You may just have to force your character to do something they don't want to do. But too many surprises and you may start to feel like you don't know this character at all, and if you can't wrangle your imagination into working properly, you may lose control of your story.
This is why I think it's important to get a good view of your character's basic motivations and history before getting to the inevitable surprises that will come when we later invent situations that these characters haven't yet experienced. Surprises are good, and can bring some fresh life into parts of your story where you think it's flagging, but you want to be sure you've got most of your character's paths set out.
To that end, I like to write questions for my characters to answer; just basic ones, like you would ask a teenager or a child. "What is your favorite color, and why? Who was your first crush? Have any of your relatives died? What is your favorite food?" Each one of these is a little gem of a story in itself, just not one you probably plan on telling. Favorite colors might have stories behind them - maybe it was the color of the first wierd alien pet or monster your character had (if sff). "Who was your first crush?" This story can give you information about your world like a deeper understanding of your character's hometown, or some other place and culture in the world. The deaths of relatives bring forth stories of their own, and you may find that the distant relatives of your characters become interesting features in the world. All these things serve to make your story more real, and the beauty of it is that they are all questions you can easily ask yourself, and see what happened to you, or you heard about. Real life almost always provides the best examples.
You wont (and definitely shouldn't) use all the stories that you come up with asking your characters these questions, but you'll have a much better idea of who they are. By asking questions that dredge up your character's more unimportant, not plot-related memories, you'll have a fuller understanding of who this person is, and that way the surprises you encounter will be less distracting and more meaningful. You'll have a fuller idea of who your characters are, which will play out on the page for the reader.
Remember, everyone is the main character of their own story, even the little villagers who you meet for just a second. Writing a piece of flash fiction from the point of view of an NPC will prepare you and the related scene will spring to life far quicker when you write it, because you'll already know something about what happens there when the heroes aren't around.
There's an iceberg metaphor that gets used a lot, and I'm going to throw it out here again. Your story is an iceberg. Only a tiny fraction of your world and your story gets told to the reader, but you have to know all of it for the whole thing to float. Make sure you know your characters and your world, and your story will flow like music.