First off, there is pretty good documentary evidence that this festival refers to the Jewish rededication of the Temple in 164 B.C.E., following a military victory over Antiochus IV Epiphanes, who had had the Temple descrated three years before. The military campaign was lead by Judah Maccabi, or Judah the Hammer, the third of the five sons of Mattathias, who began the revolt, and mostly consisted of guerrilla warfare. The Jewish troops were greatly outnumbered and outarmed, but succeeded in regaining their independence anyway, even though in reality, it wasn't just a war of insurrection but a civil war, as "collaborators" were treated just as harshly as Syrian soldiers.
To fully grasp the origins of the war, you must be aware that not only was there opposition to a general gradual helenization of the country, but that Antiochus made the tensions greater by forbidding the practice of Jewish religion, forbidding circumcision, the observance of Shabbat and the traditional holidays, and the reading of the Torah. He specifically gave orders to have his troops search for and burn copies of the Torah. As the culmination of this policy of religious and political oppression, Antiochus invaded Jerusalem in 168 B.C.E. and desecrated the Temple. A year later he dedicated the altar to Zeus. Though many Jews under the leadership of Jason, the High Priest, had been conforming to the new laws, this final act set the populace against Antiochus and gave a great deal of support to those who already begun to oppose his rule, the Hasideans and Mattathias and his sons.
Small digression: There were no Chasidim as we know them in 164 B.C.E. There was a Jewish sect with the same name in Hebrew, who are now usually referred to as Hasideans. They indeed were very religiously observant and supposedly preferred martyrdom to breaking the sabbath. And as correctly stated above, their support of Mattathias and Judah Maccabi as well as their decision to fight even on Shabbat turned the tide in the war. This group might have influenced the Essenes and might even be connected to the people referred to as Chasidim in the Talmud. But there is no evidence linking them to what is now called Chasidism. Modern Chasidism distinctly traces itself from the Baal Shem Tov, a man with the given name of Israel ben Eliezer who was born in eastern Poland around 1700 C.E.
Even though at times it seems as if the main emphasis of the holiday were this victory, the actual festival commemorates the miracle that occurred during the reconsecration of the Temple. One of the features of the Temple was a menorah that was to always be kept burning continuously as a symbol of "The Eternal Light". Yet when they were cleaning out the Temple, only enough oil for one day's lighting was found. The miracle is that this oil supposedly burned and gave light for eight days until more oil had arrived.
The traditional celebrations emphasize different parts of the story.
- Many of the songs like Rock of Ages, emphasize God's role in the military victory.
- The two traditional foods are connected symbolically with the nourishing oil. Latkes because they are deep fried in oil, and Sufganiyot or Jelly Donuts because of the viscous center.
- Candle-holding or oil-holding nine-pronged menorahs are lit everyday for eight days, to symbolize both the length of the miracle and the growing increase and strength of faith and religion following it.
- Children gamble for candy, gelt (chocolate coins), and pennies with a dreidel, to commemorate the time when in order to learn Torah, people had to hide in caves and pretend that they had only been gambling in case they were caught.
Like Purim, the holiday is not tremendously important from a theological point of view, but it was important as a kind of cultural polemic and consolation for Jews who were oppressed and alienated, especially in medieval Europe. It comes right around Christmas, with the message that Jews have a history of strength and resistance, and a religion that could miraculously endure, even if only as a small light waiting to be replenished.