Well, they weren't filmed back-to-back; the actors made other films in between the Star Wars films, I'm pretty sure. (That's why Carrie Fisher won't appear in Episode IX. If they had been filmed simultaneously or back-to-back, there would be footage of her for it. There's not, unfortunately.) It also takes time to do the special effects, etc.