However, he wasn't at all certain that A New Hope would be popular enough to fund sequels (remember how risky a big-budget sci fi epic was back then,) so he essentially rewrote the entire trilogy into the first movie. When ANH turned out to be... popular (to say the least,) he wound up retelling the trilogy as he originally intended, as best he could.
And because it had already been established that Wookies were a technologically advanced species because of Chewbacca, he basically just made them smaller and reversed their names (Ewoks.)