At the end of the Laws of Chanukah, the Rambam says, "If he has before him (the choice between purchasing) lamps for the home (Shabbos candles) or lamps for Chanukah, or (the choice between purchasing) lamps for the home (Shabbos candles) or (wine for) kiddush, lamps for the home come first." Because Shabbos candles is for shalom bayis, peace in the home, and the Rambam concludes, "great is peace, for the entire Torah was given to make peace in the world."
Rashi tells us that the term, "lamps for the home" means Shabbos candles.
It seems that this law of shalom bayis should be written in the laws of Shabbos, although it mentions Chanukah lamps, it is a law pertaining to Shabbos, especially since he says, "or (the choice between purchasing) lamps for the home (Shabbos candles) or (wine for) Kiddush," which is clearly a law that pertains to Shabbos and not Chanukah. Why does the Rambam put this law in the laws of Chanukah?
Also, why is the term, "lamps for the home," used to say Shabbos candles?
To understand this, we first have to understand the difference between the three types of lamps we are obligated to have lit, the lights of Shabbos, lit by women and girls, the lights of the menorah in the Temple, lit by the Kohen, and the lights of Chanukah, usually lit by the husband or the father of the home.
In the Temple, the menorah was in the Holies, where nobody really could see the lights, and it was lit in the afternoon, specifically during the daytime. They were lit in a place where the revealed light of G-dliness shined openly, it could only be lit in a place where it was free of negative outside forces. That is why, when the Greeks entered and defiled the Temple, the lighting of the Temple menorah ceased.
The Chanukah lights, which commemorate the miracle that happened with the Temple menorah, are specifically lit after sunset, when it is dark and placed where everyone can see it. The Chanukah lights are not so we should be able to see in the dark, rather that people should see them. It is specifically lit when it is dark, lighting up the outside spiritual darkness, the darkness of the exile, and the darkness of the negative forces. As the Talmud says, that the mitzvah of lighting Chanukah lights is "until the Tarmudai finish coming from the market." Tarmud in Hebrew has the same letters as the word moredes, treason, meaning, that the lights of Chanukah even effect the furthest away from Hashem, the ones who go against Him.
The main reason that Shabbos candles are lit in the home, is so that people can see, and they won't get hurt and upset, maintaining peace in the home.
In a way, the lights of Chanukah are greater than the lights of the Temple. As the Ramban says, that the lights of the Temple ceased to shine when the Greeks entered the Temple, however, the lights of Chanukah, "will never cease." They continue to shine, lighting up the darkness of the exile.
Similarly there is an advantage of a Baal teshuva over a Tzadik. A Tzadik has nothing to do with the bad and the darkness of the world, but the Baal teshuva has the ability to transform the bad into good, even his greatest sins can be transformed into merits.
The number of lights also show the greatness of the Chanukah lights over the Temple lights. The Temple menorah had seven lamps, seven is the number of the nature of the world, for example, the cycle of the week. Even the spiritual realms work in a cycle of seven. The Chanukah menorah has eight lamps, eight symbolizes above the world, beyond both physical and spiritual realms.
In the Temple, where there was open G-dliness, there was no need for more than the light that is within the worlds. But in the mundane world, in order to overcome the darkness, we need the light that is beyond the worlds.
Although the service of the Baal teshuva is extremely powerful, we can't do without the pure service of the Tzadikim, which is in a way greater than that of the Baal teshuva, because it comes from a place of purity, void of any possibility of negative or evil.
In order to have the most powerful service, we need the fusion of both Tzadik and Baal teshuva, which will be the norm when Moshiach comes. As the Zohar says, "In the future, Moshiach will have the Tzadikim do teshuva." This fusion can only be brought about by a light that is higher and greater than both the Tzadik and the Baal teshuva, since it is higher it is able to unify the two.
This unifying factor is symbolized by the lights of Chanukah, which dispels the darkness of the night and the exile, and at the same time, it was established because of the Temple lights, to commemorate the miracle that happened with them.
This is hinted in the number eight, which hints to the time of Moshiach, as it says about the leer of the time of Moshiach, that it will have eight strings, as opposed to now, it only has seven. In other words, music now has seven notes, in the time of Moshiach, there will be an eighth note. How will this be possible? Because at that time, we will draw the essence of Hashem, which is higher than the worldly realms, Tzadik, and even higher than the realm that is beyond the worldly realms, Baal teshuva, therefore, it will be able to unify the two. So in the world, which is a world of seven, seven days of the week, seven musical notes, and cycles of seven in the spiritual realms, will also have the influence of what is beyond the worlds, an eighth note. It doesn't mean that it will be only in music, rather, every aspect of our lives will be infused with a higher spiritual meaning.
Now we will understand why the Rambam brings this idea of shalom bayis, peace in the home, and peace in general, in the laws of Chanukah. Because peace is the bringing together of opposites, sometimes even diametric opposites. And in our case, we are talking about several unions. The unification of the home, in order to make it into a home for Hashem. The union of husband and wife, which could be diametric opposites, as the Torah calls the wife "ezer kenegdo," that she could be "kenegdo, against him," but hopefully an "ezer, a support to him," if they are at peace. Shabbos candles help bring that peace. Then you have the opposites of the darkness and light. And finally the opposites of worldly and extra-worldly.
Chanukah represents the ability to bring opposites together, it is all about peace, therefore it is apropos that the passage about peace in the home, be brought in the laws of Chanukah.
And it calls Shabbos candles, lamps for the home, because when a woman lights Shabbos candles, she is bringing peace to her home and that is what makes it a home.
The Rambam is telling us that although Chanukah lights do amazing things, lighting up the darkness and fusing the service of the Tzadik and the Baal teshuva, and worldly and extra-worldly, but when you have to choose between Shabbos and Chanukah lights, you should choose Shabbos candles, because shalom bayis is more important.
May we have peace in our homes, and may Hashem feel at home in our homes. The Shechina only rests in a peaceful place. This will surely affect everyone in the home, which will affect everyone they come in contact with. And in this way, we will effect the whole world, making it into a home for Hashem, and usher in the time of Moshiach, when we will have the essence of Hashem, and the aforementioned fusion. May it happen soon.