In both a positive mitzvah (#495) and a negative mitzvah (#496), the Torah requires us to follow rabbinic enactments. Seven of these are considered the “Sheva Mitzvos d’Rabbanan,” the “Seven Rabbinic Mitzvos.”
The Torah (Exodus 35:3) prohibits lighting a fire on Shabbos. This was taken by the Sadducees to mean that we must sit in the dark all Shabbos, which is not the Torah’s intention. Accordingly, the Sages instituted that we should have a light burning in our house from before Shabbos begins. The reason for this is shalom bayis–in order to have peace in the home–since stumbling in the dark and banging into things is not conducive to a pleasant Shabbos experience.
Lighting Shabbos candles is so important that even someone who doesn’t have food must borrow money to acquire them. The basic practice is to light two candles, one corresponding to “shamor” (the negative mitzvah to refrain from labor on Shabbos) and the other corresponding to “zachor” (the positive mitzvah to remember Shabbos through our actions), though many have the custom to add additional candles corresponding to the number of people in the household.
The laws of Shabbos candles are detailed in the Talmud throughout the second chapter of tractate Shabbos. This mitzvah is codified in the Shulchan Aruch in Orach Chaim 263.