I plot out a few thousand years of history for the setting so that there are recognisable strata of cultures in the locations the players explore. I usually tie quests and narratives into the history so that its all meaningful and not just window dressing.
I do usually use an existing setting as a base, preferably one that has some established history to build off, usually Greyhawk.