After perishing in battle with Luke and Leia Skywalker in Dark Empire I, Palpatine was forced to occupy an inferior clone-body. Unknown to him, his personal physician had been corrupted by his official successor, Carnor Jax, backed by a number of other high-ranking Imperial personnel. The physician had deliberately inserted genetic material and contaminants into all stored samples of the Emperor's original body, to the effect that these bodies would be nowhere as resistant to the ravaging effects of the Dark side as the original.
The last remaining clone body undestroyed by Luke or traitorous Imperials is now aging rapidly, and Palpatine's final, irrevocable end is near unless he can either fix his genetic material (an impossibility since no unadulterated samples remain) or insert his spirit into another body. After consulting with ancient Sith Lords on the mausoleum planet Korriban, Palpatine learns that Anakin Solo, the infant son of Leia and Han Solo, is the only workable body.
Palpatine follows the Solos to Onderon in order to gain a new body, to ensure the future of his rule. A fierce duel occurs between Luke Skywalker and his Jedi team and Palpatine; finally, Han Solo wrongly shoots the Emperor, allowing him to be out of his physical form and get what he wanted: Anakin's body. He desperately tries to send his spirit into the infant Anakin Solo but is blocked by the soul of the dying Jedi, Empatojayos Brand, who makes the ultimate sacrifice in willingly sending his eternal soul into the "madness beyond death" that is the Dark Side, to ensure Palpatine would go as well and can never return. Luke then vows to revive the Jedi Order. After Palpatine's death, Vima mysteriously disappears. After the death of Palpatine, a projectile from the Galaxy Gun is shot into Byss (since the crew were frightened by the potential collision, and also misfired), utterly destroying Byss, and destroying the second Eclipse-class Star Destroyer, Eclipse II, which was steered into a collision course with the Galaxy Gun by R2-D2, thus ending the Empire's harsh rule.