Here's a simple idea inspired by noisms' observation that having a basic idea about your setting is key to improvisation. I would add that at the same time, you have to come up with ideas that fit the setting but stay fresh, because the imagination under pressure reverts to mediocrity. So how do you turn the stale into the fresh, without veering off the deep and and having encounters with toasters and snuffleupagi?
One answer is to take the elements of your familiar setting and combine them in new ways. Let's say your party has decided to flip the bird to your carefully prepared plans, and heads to a village of adventure you haven't prepared, in hex 2049, the genre being medieval European fantasy. You quickly fill the hexes around with the first ideas that come off the top of your head, in adjective-noun format. Then to your dismay you realize they're all old-hat cliches:
So, just switch the adjectives across the middle, and you're left with this set of encounters that really crackles and challenges:
D&D variant: specialty mages
4 hours ago