Lucas had his rough outline of the basic plot points and fleshed everything else out as he went.
I know you guys like to talk about how Lucas can't keep his details straight, but as far as I can tell his story has better continuity than most pre-planned stories.
To me the finished saga is an intricate yin yang of mirror images. To me it's quite an accomplishment that it turned out with as solid a continuity as it does considering the way Lucas fleshed it all out as he went.