first, its origins: i believe that it was originally created to be a helper/personal assistant/protector of the princess or queen. it’s small, light in color, automated and mainly follows around one person, and most importantly: it reacted to zelda’s magic. it was not active until zelda’s powers awoke. and it’s not just that the light “purified” it and woke it up - if that were the case, all of the other guardians should have returned to normal or activated if not yet working, instead of turning off completely. no, light shone from the egg itself, suggesting it hosts some sort of divine power or energy. the egg being powered off of this sacred power would suggest, or at least support the idea, of a link between the guardian and zelda. sure, it follows link around in the gameplay because he’s the main character, but it’s been emphasized that it has an attachment to zelda. even the tapestry depicts the guardian at her side.
[edit: pre-game release speculation below]
now, in the “original” timeline, this egg guy was inactive because zelda’s powers were not yet awakened. i believe that the evil cloaked guy seen in the trailer found this little egg guardian somewhere and then used malice to activate and corrupt it to use it as a spy/looking glass/glass ball. from the little we’ve seen, we know that they possess some sort of knowledge or power over malice and corrupted sheikah tech, as shown by the corrupted ancient core-esque thing they held. if they really were the fortune teller, this would make even more sense, with the spying and such.
later on, the egg gets deactivated somehow - caught in a crossfire and busted, somehow cleared of malice, whatever – and eventually found by the princess or someone else. it’s fixed up, but can’t be turned on. it gets abandoned when zelda’s forced to give up her side projects in favor of prayer.
then, her powers awaken, and the guardian meant to protect her is awakened with it. her command to it: protect everyone. to which it does a little nodding gesture.
another theory, from nintendoblackcrisis, suggests that the egg going back in time is the result of a wish from zelda harnessing the full power of the triforce with the awakening of her power. while i definitely think this could be the case... 1. we don’t know if she actually possesses the triforce or if it’s just a stylistic choice/representation of her power, and 2. according to lore, the triforce returns to the sacred realm after granting a wish. if she truly did have the triforce and that truly was her wish, well. the triforce would have left, right? and presumably that didn’t happen. though i suppose you could argue that we don’t see the aftermath of that wish/command in that timeline just yet. either way, i think that would be a... strange roundabout way of the triforce granting the wish rather than just. Fixing Things like it normally does. in my opinion, a connection between a princess and the guardian built to assist her, linked by her divine power, is a much more personal tale than just “triforce did it.”
TL;DR: egg was made in ancient times as a personal assistant/guardian to the princess, linked by and/or powered by her magic. it did not awaken until our zelda’s powers did, and responded to her command to “protect everyone.” in the og timeline, the inactive egg was found and used by evil malice guy as a spy, but eventually gets deactivated, found, and placed in zelda’s study.