In the second century BCE, the Holy Land was ruled by the Seleucids (Syrian-Greeks), who tried to force the people of Israel to accept Greek culture and beliefs instead of mitzvah observance and belief in G‑d. Against all odds, a small band of faithful but poorly armed Jews, led by Judah the Maccabee, defeated one of the mightiest armies on earth, drove the Greeks from the land, reclaimed the Holy Temple in Jerusalem and rededicated it to the service of G‑d.
When they sought to light the Temple’s Menorah (the seven-branched candelabrum), they found only a single cruse of olive oil that had escaped contamination by the Greeks. Miraculously, they lit the menorah and the one-day supply of oil lasted for eight days, until new oil could be prepared under conditions of ritual purity.
To commemorate and publicize these miracles, the sages instituted the festival of Chanukah.