The original producer of the first two Star Wars movies says that Lucas's priorities shifted away from film making after Empire Strikes Back, which vastly changed the shape of Return of the Jedi.
Two men were present at the birth of Star Wars, one of the biggest media franchises of all time. One of them was George Lucas, and the other was Gary Kurtz. Kurtz served as producer for both Star Wars and Empire Strikes Back, but said that after the second movie, Lucas cared more about the merchandising than he did about the films.
By 1980, the Star Wars toys made three times as much as the actual films so it was natural that LucasFilm's priority as a business was to protect that source of revenue, but Kurtz feels that this meant the movies themselves suffered. "The emphasis on the toys, it's like the cart driving the horse," he said. "If it wasn't for that the films would be done for their own merits. The creative team wouldn't be looking over their shoulder all the time."
The focus on merchandise had a huge effect on Return of the Jedi, Kurtz said. The original outline called for a much more grim ending to the trilogy, with the rebel forces in disarray, Leia struggling with her new responsibilities as queen, Luke walking off into the sunset, and Han dead in the second act. But Lucas didn't want that, Kurtz explained, and changed the outline significantly. "Instead of bittersweet and poignant he wanted a euphoric ending with everybody happy," Kurtz said. "George then decided he didn't want any of the principals killed. By that time there were really big toy sales and that was a reason."
While there's no shortage of people ready to criticize Lucas for the rather disappointing prequel trilogy, it's debatable whether Kurtz's darker ending would really have been a better way to end the trilogy. For what was effectively a series of fantasy movies in space, ending on such a somber note just seems incongruous.