http://secrethistoryofstarwars.com
But thats if you want the long answer.
The short answer is that pretty much most of it was made up. In 1977 Lucas held that sequels were possible, and had a trilogy by contract, but he didn't have much in the way beyond the obvious--ie that Luke continues to train as a Jedi, Leia has the romance with Luke and Han, the rebels continue their fight, and the climax is Luke and Darth having a lightsaber battle. He didn't know if he would ever film these two sequels, and might not have even wanted to anyway, so he had Alan Dean Foster writing them as novels. When the film was released and became the biggest movie of all time Lucas realised he could turn it into a franchise that could be a huge cash machine that could finance his dream--Skywalker Ranch. So the Star Wars franchise was going to be like James Bond where there was a new film every year or two that would keep the facility in business, the series was infinite because you could write an adventure about anything in the galaxy. As he started work on ESB in late 1977 he settled on a figure--12 films, which would bring him into the year 2001 by the time they were done. 12 because thats the tradition of the classic serials--Flash Gordon, Phantom Empire, Fighting Devil Dogs, they are all 12 chapters long.
In 1978 Lucas wrote a second draft of ESB himself where he decided that Vader was actually Luke's father. This draft was still titled as Episode II, but when he came back a few months later with Lawrence Kasdan to write the final drafts he had decided that the new backstory involving Anakin's fall to evil would make a good series itself--which is why these drafts are no longer Episode II but Episode V. He reveals a few months later that there are in fact 9 episodes--a prequel trilogy, the current trilogy and then a sequel trilogy. They are 3 seperate series with different styles and tones and themes and characters, but chronologically connected if you viewed them in episodic order. My explanation is that actor availability forced Lucas to commit to a trilogy structure--he had Hamill and Fisher under contract for 3 films but thats it, and they probably wouldn't want to do more, and Harrison Ford had to be seriously persuaded to do a third film let along four or five. So this trilogy structure would be structural basis for any other spin-off series--he settled on one taking place before and one taking place after. But then after ESB was filmed he realised how unpleasant making these films are, they were destroying his personal life, so he decided to be done with Star Wars (the Ranch was about to be done construction anyway) and adopted a daughter, but even by then it was too late as he got a divorce by the time ROTJ was released. Close to half of Lucasfilm was split in the divorce, so he was in some difficult financial times in the 80's.
In the early 1990's Star Wars became immensely popular again, and Lucasfilm was suddenly making a comeback with all the Lucasarts games, EU novels and Dark Horse comics. Seeing that there was a massive audience for Star Wars again, he realised that now he could get back his loses--he had always been genuinely interested in the prequel trilogy, unlike the sequel trilogy which was mainly a response to success, and with the CG revolution of 1992 and 1993 he now seriously had the option of doing the films and getting, in his mind, financially free. Since he had been wanting to get back to directing anyway, he decided he would finally make the films, and then became interested in using the prequels to sort of change the way the viewer looked at the OT. He also decided somewhere along the post-1993 road that the series could be re-interpreted to be about Vader, beginning with his discover and ending with his death.