Prior to the events of Secret Wars:
The Illuminati assembled after Black Panther discovered that another Earth was colliding with Earth-616. Reluctantly he called the Illuminati together to stop the collision. After long debate they decided that the only way to do so was to destroy the other Earth with the Infinity Gems, but had to find the Mind Gem that was in the possession of Charles Xavier before he died. Beast eventually recovered a memory implant put in his mind by Xavier, which asked him to take his place in the Illuminati, and where the gem was. As soon as Hank retrieved it, Namor, Black Bolt, and Captain America showed up and recruited him into their team.
They went to the location where the other Earth would hit and formed the Infinity Gauntlet, which got the attention of Uatu the Watcher, Galactus, and Thanos. The group decided Captain America should wield it. Cap fired the power at the other Earth, but something went wrong and caused all the Infinity Gems to shatter except the Time Gem, which suddenly vanished.