The core halacha is that seeing the Chanukah lights is itself bound up with the mitzvah, not merely incidental to it: Shabbat 23a:6-7 records that Rabbi Yirmeya held one who sees a burning Chanukah light must recite a blessing because the mitzvah is to see the light and not only to kindle it, so one who sees the lights without having lit recites She'asah Nissim (and Shehecheyanu on the first night), as codified in Shulchan Arukh, Orach Chayim 676:3-4.
The purpose of placing the lights where they can be seen is to publicize the miracle: Shabbat 21b:8-10 teaches that the lamp is placed at the entrance outside, or at a window facing the public domain, so that all can see it, and Shabbat 22a:1-3 rules that a lamp placed above twenty cubits is invalid because people do not ordinarily raise their eyes to see at that height, since the requirement to see the lights is what defines their valid placement.
Because the lights exist to be seen and to publicize the miracle rather than for mundane use, Chazal forbade deriving benefit from their light: Shabbat 21b:8-10 and Shabbat 21a:12 establish that one must kindle an additional light to use for illumination, and Shulchan Arukh, Orach Chayim 673:1 codifies that it is forbidden to use the Chanukah light even for checking coins or for Torah study, a rule Kitzur Shulchan Arukh 139:14 explains is implemented by placing the shamash near the lights so that any light used is attributed to it, and Mishnah Berurah 673:7-8 adds that this is so that the lights are recognized as mitzvah lights publicizing the miracle, paralleling the Temple menorah which was never used for ordinary benefit.
The time and manner of lighting are tied to maximizing visibility: Tur, Orach Chayim 672 and Shulchan Arukh, Orach Chayim 672:1-2 rule that the lights are lit at sunset, with enough oil to burn through the half-hour when people are passing in the streets and can see them, since that visibility is what accomplishes the publicizing of the miracle, and Mishnah Berurah 672:11 adds that if the household is asleep, the blessing is said only when there is someone present to see the lights, since the blessing is tied to the actual publicizing moment.
Mishneh Torah, Scroll of Esther and Hanukkah 4:12 frames the entire mitzvah as exceedingly beloved, requiring great care in fulfilling it specifically in order to publicize the miracle and add to the praise and thanks owed to God, going so far as to say that even one who must beg or sell his garment for oil and wicks must do so — underscoring that the visual testimony of the lights is the whole point of the mitzvah, not an incidental detail.
Among the Acharonim, Kitzur Shulchan Arukh Yalkut Yosef, Orach Chaim, ברכת הרואה נר חנוכה 676:6 rules that one who sees Chanukah lights kindled in the synagogue within the half-hour of their lighting recites the blessings of seeing, because the custom of lighting with a blessing in shul is itself treated as binding practice, so the viewing there carries the same halachic weight as viewing lights lit at home; and Mishpetei Uziel, Volume I, Orach Chayim 7:20 similarly holds that since the lighting itself constitutes the mitzvah in the case of Chanukah (unlike Shabbat candles, where the mitzvah is the presence of a lit light), an electric light does not fulfill the lighting obligation, and consequently one who sees only such a light does not recite She'asah Nissim or Shehecheyanu over it.
On the hashkafic plane, several Hasidic sources read the act of seeing the lights as touching something beyond the physical mitzvah: the Sefat Emet, Bereishit, For Chanuka 1:3 explains that the blessing She'asah Nissim is said specifically on seeing the candles because the illumination of the miracle itself resides in the lights, which remain sacred since the miracle persists through the generations; and Sefat Emet, Bereishit, For Chanuka 4:5 connects the placement of the lights outside the house to the opening of fear of Heaven within each Jew, through which one becomes able to receive the inner light of Torah.
Other hasidic and kabbalistic treatments similarly view the candlelight as carrying a spiritual light beyond nature: Shem MiShmuel, Chanukah 1:9-10 describes the lighting as removing concealments so that a lofty light already flowing from above can shine below, Likkutei Sichos 3 חנוכה explains that Chanukah lights, numbering eight, reach beyond the natural order represented by the Temple's seven lights to illuminate even the outer darkness of exile, and Hemshech Ayin Beis 5675 ש"פ מקץ, ש"ח, העת"ר draws a contrast between Shabbat lights, placed to the right to illuminate the home, and Chanukah lights, placed outside to the left, reflecting a descent of light from the Infinite beyond the grasp of created beings; Maamarim Melukatim Chanukah likewise explains that the differences between the Temple menorah and the Chanukah lights in number, placement, and time all serve the purpose of illuminating the darkness, including the public domain, and publicizing the miracle.
The mystical significance of fire and gazing at it more broadly appears in Chochma uMusar (Alter of Kelm), which links the Chanukah light to remembrance of the miracle and Divine providence, leading one to fear of Heaven, and in Responsa Benei Banim, Volume II, Miscellanea 1:1-3, which discusses the practice of gazing at a flame before reciting the blessing over fire, rooted in earlier sources describing looking at one's fingernails by the light before saying Borei Me'orei HaEish.
Several Talmudic and halachic sources round out the practical framework surrounding visibility and use of the lights without bearing directly on the seeing-obligation itself: Shabbat 21b:5 sets the base requirement of one light per household with the mehadrin practice of additional lights, Shabbat 23b:2-4 and Shabbat 22b:2-3 discuss technical rules of multiple wicks and the ner ma'aravi testimony of the Temple menorah, Mishnah Berurah 676:9 and Magen Avraham 673:2 detail the order of lighting and prohibitions on incidental use, Sfas Emes al HaShas, Shabbat 21b and Sfas Emes al HaShas, Shabbat 23a and Ein Aya, Shabbat 2:5 analyze the extent of the prohibition on using the light, and Derashot HaRan 5:49 and Ner Mitzvah, Volume II:14 and Chiddushei Aggadot, Shabbat 21 trace the scriptural basis of the blessing and the symbolism of the 25th of Kislev as the turning point toward increasing light.
Teshuvos V'hanhagos 6:158 rules that the one who lights must himself also see the candles and recite She'asah Nissim upon seeing them, and cites the Mordechai's formulation that the lights may be used only for viewing as proof that the viewing itself constitutes a mitzvah.
Revavos Ephraim 8:265 rules that one should remain in the room where the menorah is burning for the half hour of its required burning time specifically so that one can see the lights during that period.
Igros Moshe OC 5:43 addresses the practical case of one with no access to other lights, ruling he may light for himself in order to fulfill the act of seeing them, and holds that one whose wife lights at home may generally rely on her lighting unless he declines that arrangement, concluding that seeing a lit Chanukah lamp is required mainly to enable reciting the blessings and to serve as a physical reminder of the miracle, rather than as an independent obligation lasting throughout the entire lighting period.