The Death Star's superlaser was revealed to be operational before the construction of the station was completed, surprising the Alliance attackers during the Battle of Endor. This was Emperor Palpatine's plan all along, and it nearly led to the defeat of the Rebels. The Alliance ground forces on the forest moon of Endor managed to deactivate the energy shield surrounding the battlestation, and the Rebel fleet proceeded to destroy the station from within, signifying the beginning of the downfall of the Empire.
The destruction of the first Death Star over the fourth moon of Yavin was a devastating defeat for the Empire. In typical fashion, Emperor Palpatine decided that the best revenge would be to again confront the Rebellion with its greatest fear; a resurrected Death Star.
Palpatine summoned the original Death Star's lead designer, Bevel Lemelisk, ordering him to produce an even more advanced battle station. After finishing work on the Tarkin battle station, Lemelisk's design team soon completed the second Death Star's design.
Not only was the second Death Star larger and more deadly, but several flaws in the original design were corrected; the vulnerable thermal exhaust ports were replaced with millimeter-wide heat dispersion ducts, leaving no weak spots in the battle station's armor. The finished design increased the overall size of the new Death Star to 200 kilometers in diameter. The north pole of the station featured a one-hundred story tower topped by the Emperor's private observation chamber perhaps the most heavily armored and shielded portion of the station.
This new Death Star's central weapon, the terrifying superlaser, featured substantially increased power, allowing it to be recharged in a matter of minutes rather than 24 hours. The superlaser's targeting and power control systems were refined so the weapon could be turned on capital starships.
Lemelisk added 20,000 turbolasers to repel attacks from starfighters and capital ships. Once completed, this station would have carried thousands of TIE Fighters, Troopers, and ground combat vehicles. This new Death Star would have been invincible; the only way to stop it would have been to destroy it while it was still under construction.
The Death Star was also part of an elaborate trap set by Emperor Palpatine to lure the Rebels out of hiding. For nearly six years the Rebels had managed to avoid detruction. The Emperor provided a target so dangerous that the Rebels could not afford to pass it up.
Palpatine allowed the Alliance's Bothan spies to learn of the second Death Star; he did not disclose the fact that the superlaser would be fully operational by the time the Rebel fleet arrived. The Rebels fell into his simple trap.
Imperial engineers built an immense shield generator on the forest moon of Endor to protect the partially completed Death Star. However, the Empire underestimated the "primitive" Ewoks indigenous to Endor's moon. A small team of Rebel commandos was able to enlist the Ewoks' aid and destroy the shield generator, thus allowing the Millennium Falcon, commanded by General Lando Calrissian, to fly inside the partially completed battle station and destroy its power core before construction could be completed.
As the second Death Star exploded over the forest moon, the Emperor was killed and his war fleet was flung into disarray. The loss of the Death Star II, the Emperor, and Darth Vader was a loss the Empire never recovered from and signaled the beginning of the end for the Galactic Empire.