The Torah teaches that light is much more than the absence of darkness; it is an independent, active force. Darkness wanted to attach itself to this force, therefore God separated between light and darkness, each remaining a separate force.
This is why the Torah wrote the words: “It was evening, it was morning, one day,” instead of writing: “it was evening and morning one day.”
When the Midrash spoke about the darkness seeking to attach itself to this light, this may refer to the abrupt change from day to night without an intervening period of dusk. Seeing that the light has been described as “good,” it was not to be followed by total darkness immediately without a period of transition. As a result of this the verse actually describes four periods of time all part of a single day.
The original darkness, which had been due to a total absence of light, was not the same as the darkness the Torah now called “night,” Nowadays only parts of the globe are enveloped by darkness at any one time, whereas prior to the creation of light the entire globe was shrouded in total darkness. (Rav Moshe Alshich, Translated by Eliyahu Munk)
The light of the Chanukah candles symbolizes the power of good in the world, to which the power of darkness is constantly attempting to attach to appropriate its spiritual energy. It is especially important to avoid inappropriate behavior in front of the candles.