what is the reason for hanukkah

Hanukkah is celebrated to remember the rededication of the Second Temple in Jerusalem and the miracle of a tiny amount of oil lasting eight days after the Maccabean revolt against the Seleucid (Greek-Syrian) rulers in the 2nd century BCE.
What Hanukkah Commemorates
Hanukkah (Hebrew for “dedication”) marks the victory of the Jewish Maccabees over the Seleucid Empire, which had tried to suppress Jewish religious practice and defiled the Temple in Jerusalem.
After recapturing Jerusalem, the Jews purified and rededicated the Second Temple, restoring traditional worship there.
The Miracle Of The Oil
Traditional Jewish sources describe that only one small jar of ritually pure oil was found to light the Temple menorah, enough for just one day.
The flame is said to have burned miraculously for eight days, giving time to prepare new pure oil and becoming the central religious reason for celebrating Hanukkah over eight nights.
Why It Lasts Eight Days
Because the oil lasted eight days, the sages instituted an eight-day festival marked by lighting lamps or candles each night to publicize the miracle.
Some historical sources also link the eight days to a delayed celebration of Sukkot, another eight-day festival that could not be properly observed during the war.
Core Themes Of Hanukkah
Hanukkah highlights themes of religious freedom, resistance to forced assimilation, and the preservation of Jewish identity under foreign rule.
It is also widely understood as a festival of light over darkness and spiritual dedication, symbolized by the nightly lighting of the menorah at home.
TL;DR: Hanukkah exists to remember the Maccabees’ victory, the rededication of the Temple, and the miracle of the oil that burned eight days, which is why candles are lit for eight nights.
Information gathered from public forums or data available on the internet and portrayed here.