Following their victory at the Battle of Yavin, the core group of Rebel Alliance heroes had to abandon their headquarters at the Massassi temples of Yavin 4. Pursued by the Empire, they eventually set up a new base on the ice planet. Code-named Echo Base, this new outpost was under the command of General Rieekan. The temperature extremes required a great deal of effort from Alliance technicians to keep all their vital supplies from freezing.
An Imperial probe droid -- one of thousands dispatched throughout the galaxy -- eventually discovered Hoth. The Rebels were fortunate enough to learn of the droid, and began evacuation procedures immediately. The Empire -- in the form of the Imperial Death Squadron -- arrived in the Hoth system shortly thereafter.
History records the conflict that followed as the Battle of Hoth, one the greatest setbacks suffered by the Rebel Alliance. The Rebels barely had enough time to evacuate their headquarters and scatter from the pursuing Imperial fleet.