The Scarab
The Blue Beetle scarab, previously shown as an artifact of magic, is later retconned as a tool of war of the Reach, an ancient race of cosmic marauders. After being defeated by the Guardians of the Universe thousands of years ago, and forced into a truce, the Reach posed as benevolent aliens lending their advanced technology to budding civilizations, with the scarab intended as a gift for that world's champion, giving him amazing powers and the knowledge of the Reach to protect his or her peers. In fact, the scarab is part of an advanced hive mind, with its own artificial intelligence covertly supplanting the wearer's own, turning it into the "ultimate infiltrator", a covert agent intended to take over its own world, as evidenced when a still-damaged scarab revives Garrett to fight Ted Kord, until Garrett is able to reassert his individuality.
Damaged when Dan Garrett forcibly extracted it from its charging cradle and located in a faux pyramid in Egypt, the scarab is first activated with chunks of its programming missing, giving several abilities to Dan Garrett, but none of the Reach knowledge base. The combined additional damage dealt by the multiversal/chronal energies fed into it during Booster Gold's mission to protect the Multiverse during the 52 event, and the magic forces of the Shadow Demons, put it into a dormant state for a year, after which it wakes, enacting its full programming to turn Jaime Reyes into the infiltrator.
However, the strong will and the good nature of Jaime Reyes, combined with the still corrupted programming of the scarab, helped its A.I. to assert itself as an individual, a tool no more. Claiming "Khaji Da" (the combined utterance of "khaji", the codeword for "infiltrator", and "da", its own serial number) as its own name at the end of said process, the scarab developed a strong bond with Jaime over time, helping him as a true friend, and even trying to spread the concept of individuality among its fellow scarabs.
Read more about this topic: Blue Beetle