I try to keep things as low prep as possible.  If I think there's going to be a fight, I scribble down some combat stats.  If there's going to be traps and obstacles, I think up some basic difficulties or target numbers.  Even named antagonists rarely get a full character sheet.
What I will write up, on the other hand, is a flow chart of possible ways the adventure could go.  So if the party encounters an antagonist in some ruins, I'll have some quick sketches of what could happen if they:
A) Attack and win
B) Attack and lose
C) Flee outright
D) Debate and win
E) Debate and lose, possibly with a segue to combat
F) Collapse the ruins
Each of these things will lead to different story points, obstacles, fights, or problems.
Maybe the party loses a ship to ship battle, then I get to run them through the problems of surviving being adrift at sea and washing up on a desert island.  Odds are low that they will decide to play Survivor for a terribly long time, so they need a chance at rescue or escape so they can get back to chasing their dreams, passions, and fears.
All of the above makes it a lot harder for me to be caught off guard by something the party might do.  The mechanics can be thrown together on the fly, but I like to have some idea in advance of how to respond to certain actions.  I always make a point, at the end of a session, of asking the party what they plan on doing next session, what their goals will be.  I don't try to script out everything, after all.  That would be silly.