Preeminence must be given to the publicizing of the miracle (Pirsumei Nisa) of Hanukkah. In truth, the subject of Hanukkah is related to the subject of the sale of Yosef, and this is the reason why Parashat Miketz — which deals with the redemption of Yosef in Egypt — always falls during Hanukkah.
We see that in the text of "Al HaNissim..." ("On the miracles..."), which is recited in the Amidah during the days of Hanukkah, the Sages who drafted it established the fall of the enemies at the hands of Israel as the main part of the miracle: "You fought their fight... You judged their judgment... You avenged their vengeance... You delivered [them]..."
Only afterwards, at the end, as if it were a secondary matter, do they mention by way of allusion: "...and they kindled lights in Your holy courtyards." From this, it is deduced that the essence of the Hanukkah candle is because of the victory and not because of the Menorah. And even regarding the answer given by the Pri Chadash (in Orach Chaim, ch. 670) — that the lighting on the first day is because of the victory — it remains difficult to say that we light candles because of a victory; for to remember a victory, we should not have lit candles, but rather commemorated the miracle in a different way.
Based on what we explained above [in previous sections], it is well understood: the reason for lighting the Hanukkah candles to publicize the miracle is not solely to make public the wonder of the oil they found to kindle the Menorah, [or that this small amount lasted eight days]. Rather, the lighting of the candles alludes to the great salvation from their enemies that Israel experienced.
Now it is understood why the Sages did not establish [Hanukkah with an obligation for] "feasting and joy" as they did for Purim.
In Purim, the benefit and fruit of the victory was the salvation of the physical body from slaughter; therefore, it is appropriate to do the counterpart to this — joy and feasting — for the benefit of the body which had been decreed to perish, chas veshalom (Heaven forbid), were it not for the victory.
But in Hanukkah, the benefit and fruit of the victory was the ability to keep the commandments of HasHem, eloKeinu, without fear or dread. Thus, there is no place for [physical] joy and feasting, but rather to thank and praise His great Name. (And this answer is somewhat similar to the answer of the author of the Levush, which was rejected by the author of the Turei Zahav, although he did not explain it in this manner.)
And the precept of Hanukkah is "[to light] a candle for a man and his household" (ner ish u'beito). This is because the essence of the miracle performed with the Menorah was to teach that they had now emerged from darkness into light and were able to fulfill the commandments, as it is written: "For the commandment is a lamp" (Mishlei 6:23).
Behold, the obligation to fulfill most commandments falls upon each individual privately when the opportunity to fulfill that commandment arises — especially regarding the laws of the forbidden and the permitted, and similar matters. However, there are commandments that can be fulfilled in public, and regarding them it is said: "In the multitude of people is the King's glory" (Mishlei 14:28), such as the recitation of the Shema, the Tefillah, and the like. Therefore, each person lights Hanukkah candles in his home [referencing the individual nature of mitzvot], and in the synagogue, they are lit for the sake of publicizing the miracle.
Zera Shimshon, Parashat Miketz, Art. 1; see there for an even broader and sweeter explanation, through which several difficulties are answered