So after Darth Vadar sacrifice his life to save Luke Skywalker by destroying the emperor. Luke collapsed onto the floor and became unconscious due to injuries sustained from being fried by the emperor and then wakes up on the surface of the Death Star.
Luke wakes up and then Jar Jar Binks suddenly appear who turns out to be the real master controlling Darth Vadar and the Emperor and was responsible for all the mass genocide by the Empire throughout the series. The motivation of Jar Jar Binks was that it was inevitable that the force powers will destroy the galaxy and therefore the emperor wipes out organics with force powers to prevent them from developing force powers to wipe out the galaxy. Luke Skywalker did not show any outrage that Jar Jar Binks was responsible for all the problems and all the death throughout the entire series and did not question the logic of his statements and did not demand Jar Jar Binks supplied any evidence to support his assertions. Luke basically took what Jar Jar Binks said on face value.
Jar Jar Binks give Luke Skywalker three choices, Luke will control all the force power in the galaxy, he could merge the force with organic beings so that everyone will become one with the force (so everyone becomes the Yoda or Obi Wan Kenobi ghost) or he could destroy all force power which results in the death of all force sensitive being (so Princess Leia must die with this choice). All of this is accomplished by using the "space magic" power of the Death Star. We have no idea how on earth the Death Star could somehow control the force power throughout the entire galaxy and this was never foreshadowed throughout the game that such device was possible.
No matter which choice he choose, Luke Skywalker has to die, all the Hyperdrive stop working which strands the Rebel Alliance fleet over Endor. Each choice results in the Death Star exploding in a red/green/blue colour depending on choice.
After the explosions we see the Millennium Falcon crash land on some planet we never seen before and then Lando, Han Solo, Chewbacca exits the Millenium Falcon implying that Lando picked up Han and Chewbacca from Endor and then ran away from the battle against the Death Star.
Then the credit roll
After that, George Lucas declared it was a movie that has an ending that was intended to be ambiguous and interpretive and was designed to create speculation for everyone.
Thanks to Doyce Testerman for his Lord Of The Rings adaptation of the Mass Effect 3 ending that inspired this