The core sugya in Shabbat 21b establishes that the eight days of Chanukah were fixed because of the miracle of the oil, and that on them one may not eulogize or fast, a point codified by the Tur (Orach Chayim 670) and Shulchan Arukh, Orach Chayim 670:1-3, who add that the days were set for the recitation of Hallel and thanksgiving rather than as fixed days of feasting and rejoicing like other festivals, with the extra meals categorized as optional, though some hold they carry a measure of mitzvah because of the dedication of the altar.
Mishnah Berurah (670:1) and the Magen Avraham (670:3-4) expand on this framework, the Magen Avraham noting the view, rooted in Megillat Taanit and the midrash on Beha'alotcha, that the days were established for feasting and joy because the work of the Mishkan was completed at this season, and that songs of praise sung at these meals can render them a seudat mitzvah.
Eretz Tzvi (Moadim p. 179) frames Chanukah as a renewal expressed through a great light emerging from concealment, and raises the Bach's question of why Chanukah was not established with feasting and rejoicing in the manner of Purim, sharpening the tension between the sources that treat the extra meals as mere reshut and those that find mitzvah content in them.
Revavos Ephraim (Revavos Ephraim 7:196) addresses directly whether Chanukah meals carry mitzvah status, noting that the Rambam and the Yam Shel Shlomo describe the days as days of joy and Hallel while the Shulchan Aruch treats the increased meals as optional and the Rema records the view that they gain mitzvah significance from the dedication of the altar.
Revavos Ephraim (Revavos Ephraim 5:348) states that the days of Chanukah are days of joy specifically because the recitation of Hallel and thanksgiving to God generates that happiness, a point that follows the Rambam's description in Mishneh Torah, Scroll of Esther and Hanukkah 4:12 of the lighting of the candles as a most beloved mitzvah meant to publicize the miracle and add to the praise and thanksgiving of God, to the point that one must even sell his garment to obtain oil for it.
Pesachim 117a explains that the Prophets instituted Hallel to be recited at every redemption, which underlies why Chanukah, as a day of redemption, became bound up with Hallel and thanksgiving as its expression of joy, echoing the general calls to rejoice found in Tehillim 118:24 and Yeshayahu 12:3.
Among the chassidic sources, Shem MiShmuel (Chanukah 18:5) locates the joy of Chanukah in the sudden reversal from the Jews' degraded and endangered state under Greek persecution to redemption, which generated the love and joy for which the candles serve as vessels, while Shem MiShmuel (Chanukah 18:6) explains that each night brings a wholly new light and a renewed joy, which is why the lights increase rather than diminish over the eight days.
Shem MiShmuel (Chanukah 53:3) ties the three Chanukah practices of candles, Hallel, and thanksgiving to three capacities the Hasmoneans restored through their self-sacrifice, with Hallel representing the uplifting of the heart in God's ways that itself constitutes the joy of the festival, and Sefat Emet (Bereishit, For Chanuka 13:9) likewise connects the joy of the dedication of the altar and the Mishkan to the ongoing illumination of the Chanukah lights, teaching that a mitzvah received with joy continues to be performed with joy.
Chochma uMusar (Alter of Kelm) roots the essential joy of Chanukah not in relief from danger but in the recognition of having found favor in God's eyes, explaining why the primary joy of Chanukah was fixed around the kindling of the oil rather than around the military salvation itself.
Among the modern poskim, Rav Mordechai Eliyahu (Maamar Mordechai Hilchot Chanukah 9:20) cites the Seder HaYom's warning that one who belittles the mitzvah of the lights thereby denies the good God has done and fails to rejoice in Israel's redemption, while Rav Mordechai Eliyahu (Maamar Mordechai Hilchot Chanukah 2:8) links the joy of Chanukah to the joy of Torah study and the resolution of halachic difficulties, and Rav Mordechai Eliyahu (Maamar Mordechai Hilchot Chanukah 7:23) grounds the name and character of the day in the fire that descended upon the rededicated altar and remained there continuously.
Rav Eliezer Melamed (Peninei Halakhah, Festivals 1:13) and Rav Eliezer Melamed (Peninei Halakhah, Festivals 1:14) describe the general mitzvah of festival joy as encompassing song, dance, and overcoming one's worries to rejoice before God, and Rav Eliezer Melamed (Peninei Halakhah, Zemanim 11:6) applies this to Chanukah specifically as the celebration of the Oral Torah, whose light, though more modest than that of the Written Torah, grows ever stronger.
Likutei Moharan 24:10 and Tanya, Part I; Likkutei Amarim 26:1 describe joy as the force that elevates holiness and overcomes the evil inclination, which the alacrity born of joy rather than the sluggishness born of sadness is what allows victory over one's nature, a principle that undergirds the broader chassidic treatment of Chanukah joy found among the other sources above.