It’s a bit of both
I have set pieces, but I’m fully aware that half of them won’t happen because the players will either screw up and miss them, or be brilliant and bypass them, so I actually have redundant layers (for want of a better term) of set pieces, just in case. I always have an ending to work towards, because I treat the game like a story, and a story needs an ending and resolution.
The other thing I do is make the plot non-player-character driven. This probably works best in long campaigns, but it works in a short scenario, too. If you know what your chief baddie is doing and why, you can write the “story” of how he wins without the players getting in the way. Then when the players do get in the way, you still know what he’s aiming for so you put yourself in his mind and think, that went tits up, what do I do next? This gives you your next set piece, and the future story adjusts accordingly. You don’t need all the redundant set-pieces prepared, though you do need to be able to quickly plot them on the fly (or, worst case, end the session early so you can get ready for next week).
But there are other ways of doing it – in our early days of playing D&D, it was enough to have a huge dungeon complex full of encounters, with no goal other than killing monsters for fun and treasure. A goal like “the king wants these monsters cleared out and as a reward you can keep whatever treasure you find” is a goal (though not a particularly good story). To be honest I would probably suggest that approach for any beginning GM (especially one who comes from board gaming – or wargaming, as I did), as it’s all set pieces that work in any order and you don’t have to worry about keeping the narrative straight, you can just have fun hacking up monsters while learning how to play “in character”.
Probably more than you needed to know . But now I might adapt this for my next blog post. Thanks