Luke allows himself to be captured by Imperial troops, who take him to see Vader. He tells him that he has accepted that Vader was once Anakin Skywalker and urges his father to return to his former self. Luke says that he can feel the good still in Vader. Apparently Vader isn't feeling it though, because he takes Luke to the Death Star to meet the Emperor.
Once aboard the Death Star, Luke meets Emperor Palpatine, the skull-faced leader of the Empire and practitioner of the dark side of the Force. He's obviously counting on Luke being a chip off the old block, who can be goaded into losing his temper and giving in to the dark side.
He has the perfect weapon to use against Luke when the rebel fleet arrives to attack the Death Star and the shields are still up. Huh. It's almost like the team down on the moon shouldn't have been bumbling around, wasting time instead of sabotaging the shield generator. The Emperor gleefully informs Luke that he allowed the plans for the Death Star to be stolen in order to lure the rebels out in the open where they could be destroyed.
The rebel ships engage in fighting the Imperial ships while waiting for the shields to come down. Then, to everyone's shock, the supposedly unfinished death star powers up its laser cannon and blows up a rebel destroyer. The station is fully operational! Admiral Akbar wants to call off the attack, but Lando convinces him to hang on and give Han and the others more time to get the shields down. Meanwhile on the Death Star, the emperor sneers at the pitiful rebellion, telling Luke that it will be stamped out and all his friends killed. Luke is visibly infuriated and the emperor encourages him to give in to his hate and embrace the dark side. Eventually he breaks, grabs his lightsaber, and takes a swing at the emperor, but his attack is parried by Vader.
Down on Endor, the strike team has actually managed to find its way to the shield generator. A surprise to no one by this point, they haven't developed a plan beforehand for the not-unlikely possibility that it would be guarded and are now crouched in the bushes trying to figure out what to do. The Ewoks take it upon themselves to attack the stormtroopers and draw them away so that Han and his team can work on getting the shields down.
Thus begins the battle of Endor between a rag tag tribe of stone age teddy bears and a large force of the feared Imperial stormtroopers who are clad in armour, carrying blasters, and using vehicles armed with laser cannons. Of course, the Ewoks win, because, um... never mind, they just do. Don't ask questions.
Back at the generator, our tough rebel heroes haven't fared as well; they've managed to get themselves captured by the stormtroopers. Fortunately, they are rescued by Chewbacca and his Ewok bros and go back to trying to get the shields down. Leia has been wounded in the fighting, but is O.K., and they manage to get into the generator and load it up with explosives, blowing it up and bringing down the shields on the Death Star.
Of course, all of this has taken time and the rebel fleet has been struggling to stay alive as they wait for the shields to come down and suffering grievous losses. On the Death Star, Luke has regained control of his emotions and backed off, refusing to fight his father. Unfortunately, Vader uses the Force to reach into Luke's mind and discovers the fact that Leia is Luke's twin sister. Gloating, he suggests that, if Luke can't be turned, perhaps she can. Luke snaps and rushes to attack Vader: they fight for a while, but Luke is obviously besting his father and eventually knocks him down, cutting off his mechanical hand.
Luke looks at his father's severed hand, and then looks at his own mechanical one, realizing that he is becoming just like Vader. He steps back, shuts off his light saber, and tells the Emperor that he has lost; Luke is a Jedi, like his father before him.
The Emperor doesn't take disappointment very well and hits Luke with finger-lightening. Luke, writhing on the floor, calls out to his father, who has managed to haul himself upright again, for help. At first Vader doesn't react, but as the torture continues, he seizes the Emperor from behind. Wracked by Palpatine's out-of-control lightening, Vader manages to carry his master to a conveniently placed bottomless pit and tosses him in. The emperor falls to his death, spewing lightening all the way. Once he's gone, Vader collapses.
By this time, the strike team has finally managed to get the shields down and the remaining rebel ships attack the Death Star, led by Lando in the Millennium Falcon. They hit the station's equivalent of a glass jaw and it starts to be rocked by explosions. On board, Luke is trying to carry his fatally injured father to an escape pod. Collapsing under his weight, Luke stops to rest and Vader tells him to take his mask off. Luke does and, dying, Vader gasps out that Luke was right about him. Once he's gone, Luke continues to an escape pod. And then the Death Star blows up.
Down on the moon, there are wild cheers as they witness the destruction of the battle station. Han tells Leia that he's sure Luke got off of the Death Star before it exploded. Leia says she knows he did: she can feel it. She also- finally- tells Han that Luke is her brother, ending his inexplicable jealousy.
Unsurprisingly, Luke has made it off the Death Star, and with his father's body, too. He builds a pyre and cremates Darth Vader. He then goes to the Ewok village where there's a party going on. Before he joins in, Luke looks out into the dark and sees three ghostly figures: Ben Kenobi, Yoda, and his father.
Leia draws Luke into the celebration; everyone hugs, the Ewoks dance and chant, and... that's how the trilogy ends.