When building a world, I use one of two approaches: Either figure out the geography or write down the societal history. I can then use the one to influence the other and then move on to the rest of the world.
When building a world for the sake of worldbuilding, I like to create the geography of it first and then let the society play out its own history. But when building a world for a story, I have to work on the history leading up to the story, to determine how the society evolved to its current state. Then I figure out the geography I need to let that history play out (for example, maybe I need to have characters live in a city on the slope of a mountain, and so I create a mountain range).
While working on one of my current worlds, I determined that a specific city needed to be in or near the foothills of what I've called the Great Western Mountains. That's fine enough; most of the rest of the immediate area in the east is flat and gently starts to become more mountainous, with a couple hills here and there. The issue, though, is that in order for the city's history to develop to where it is in my story, I want to have a great battle take place in a long, grassy plain outside the city - kind of like the Battle of the Pelennor Fields, for all you Tolkien fans. The problem? I can't come up with a good reason for there to be a giant plain in the middle of the foothills of the Great Western Mountains. I'm not willing to change the battle setting, because when last I checked, cavalry charges are not good on forested mountain slopes.
This isn't the only time I've had the geography of my world clash with its history. At least one island city has never come to fruition because I determined that the mountain islands it resides on would, in a realistic world, extend north on the mainland in a large mountain range that blocks off a trade route or two. These aren't fantastic examples, but the point is, I've had many cases where I can't have a certain setup and preserve historical and scientific realism.
The obvious solution here is to develop the geography and history side by side, integrating each into the other. My reason for not doing so is that I tend to end up with either a world that is scientifically unnatural (e.g. a peninsula that spontaneously juts out from an otherwise flat coastline) or a world with an implausible history (e.g. General Thel has to make a detour along a mountainous ridge that I've had to make instead of engaging the enemy's much smaller force on the valley floor I originally wanted but had to get rid of).
Maybe this is just the result of a lack of imagination on my part, and an inability to see solutions to these issues (as well as the terrible examples I've given), but this sometimes becomes a problem I can't solve. So when I'm trying to build a world, and I need event X to happen at location Y, but the two are incompatible, what can I do? How do I build a world that doesn't behave like I want it to?
Please note that I'm not asking how to solve the specific examples I gave, but the case in general.