Internal circadian clocks set sleep patterns and meal times and regulate biological processes, such as the flow of hormones, the body's response to sugar and others. Creatures probably developed circadian clocks to protect their fragile DNA from the sun's damaging ultraviolet rays. While many scientists favor the view that multiple organisms independently evolved their own circadian clocks, each reinventing its own wheel, other researchers think there had to be one master clock from which all others came. It evolved to protect the cell from oxygen damage or provide other advantages.
As the National Institute of General Medical Sciences explains, circadian rhythms are physical, mental and behavioral changes that follow a roughly 24-hour cycle, responding primarily to light and darkness in an organism's environment. Biological clocks drive circadian rhythms. The biological clocks that control circadian rhythms are groupings of interacting molecules in cells throughout the body. A "master clock" in the brain synchronizes all the body clocks. The "master clock" that controls circadian rhythms consists of a group of nerve cells in the brain called the suprachiasmatic nucleus, or SCN. The SCN contains about 20,000 nerve cells and is located in the hypothalamus, an area of the brain just above where the optic nerves from the eyes cross (http://www.nigms.nih.gov/Education/Pages/Factsheet_CircadianRhythms.aspx).
According to Science News, circadian clocks are composed of RNA molecules and proteins that oscillate in abundance. At certain times of day, some clock proteins produce messenger RNA, used by the cell to make fresh batches of other clock proteins. When those proteins reach a certain threshold, they stop creation of the messenger RNA that produces them. The proteins disintegrate or get destroyed by other proteins until their levels fall below a threshold. That signals the need for another batch, and the cycle starts again.
Circadian clocks are necessary for the survival of most organisms living on earth's surface. The idea that organisms are doing a "flight from light" comes from the fact that cells often replicate their DNA at night safely under cover of darkness and repair it during the day when UV light damage accumulates. Some of the protein cogs that drive the circadian clocks are also involved in DNA repair, further cementing the connection, the Science News article concludes.