I do both. Some are planned, some are not. In a sense, some of us fly by the seat of our pants more than others. If I conceive of a character or plot-line, they don't always work. No matter how you tweek it, the thing doesn't come out on the pages like you thought it would, and yet the story itself is good as a whole. That means you have to change directions. Some people are better at that than others. A rigid structure wouldn't work as well for me.
As for me, I like to allow for a bit of spontaneous discovery. If in my writing, I grow fond of particular person, or couple, I may build a secondary plot around them, or their relationship.
I believe in what I call Incidental Inspiration, which is accidently saying something very profound and meaningful, moreso than what you planned to say.
This can all get very psychological or quasi-spiritual. But we all have a different approach to things. In science, they realize that some people are right-brained dominant, others left-brained. People can write from either side, but what and how they write will differ. I tend to be most creative when I am spontaneous. Others would do better by mapping everything out, and don't fly by the seat of their pants.
We say things subconsciously. Some called them "Freudian slips", in that we have a conscious and subconscious mind, and the two don't always know what the other is thinking. Sometimes our most creative moments aren't planned or mapped out. So, while I am writing my story, something may jump out that I like and want to keep that was entirely unplanned. I love those moments. In a sense, perhaps sometimes it's inspiration, other times a part of your mind clicking in.
You think, "Wow, this wasn't what I was planning, but it's better." In my opinion, creativity should never be too anal (Obsessive compulsive-it has to go like this-this is the exact formulae-you must never deviate) where there isn't room for flexibility. Allowing for unplanned sub-plots really works for me. I'm not sure it works for others as we all think very differently.