The Gods are the creators of time itself as well as the origin points for all things.
When the Gods created the original timeline that once existed prior to its being tampered with by the Prince, Kaileena, was inadvertently created as a byproduct of the original timeline itself.
As a result, Kaileena held within her the power of time itself and created the Sands of Time. As the Dahaka is the Guardian of the timeline, he may have also been created by the Gods to counteract errors created by the Sands of Time.
It is widely believed that the Gods are responsible for the creation of all things. The Prince refers to the Gods being the origin of all things magic as a "Politician's answer".