At the time that Christ was on the earth, did they have the sealing power that we have today? And if so why did Elijah need to give it? Why not Peter?
After Peter made his confession of faith, Jesus promised him “the keys of the kingdom of heaven” which was to contain a portion of the sealing power: “and whatsoever thou shalt bind on earth shall be bound in heaven: and whatsoever thou shalt loose on earth shall be loosed in heaven” (Matthew 16:19). We need only read the next chapter to find the fulfillment when Elijah and Moses came to visit them on the Mount of Transfiguration (Matthew 17:1-9). Latter-day Saints have a better understanding of that singular event because it happened again in our own history! After building and dedicating the House of the Lord in Kirtland, the Lord came and accepted the temple. Joseph Smith and Oliver Cowdery were then visited by Moses, Elias, and Elijah who gave them the specific keys needed for the last days (D&C 110). From the similarity of the events, we conclude that Moses and Elijah gave to the original apostles the keys of the gathering of Israel and the sealing power, and Joseph Smith confirms it for us. “The Savior, Moses, and Elias [Elijah], gave the keys to Peter, James, and John, on the mount, when they were transfigured before him” (seeTeachings of Presidents of the Church: Joseph Smith, (2011), 101–13, The Everlasting Priesthood).
As you note, Peter, James, John already bestowed keys on Joseph and Oliver (D&C 27:12-13), and they themselves already held the keys which would later be given the modern ministers by other angels. So why weren’t the keys given then? After all, when a convert is ordained a priest, he doesn’t have to receive authority of a teacher and deacon separately. The central principle to understanding this matter is taught to us by yet another angel passing keys on to Joseph and Oliver.
When John the Baptist conferred the Aaronic Priesthood, including the keys included therein, he stated he was doing so “under the direction of Peter, James and John, who held the keys of the Priesthood of Melchizedek” (Joseph Smith-Testimony 1:72). John is here sharing that, while he holds the responsibility to dispense the keys of the Aaronic Priesthood, he may only do so under the direction of someone who holds the keys of dispensation. This is akin a stake president attending a ward when a new deacon’s quorum president is called. He holds the keys over the stake, and yet you will find the bishop still exercising his keys in calling the new president and conferring keys on him. The bishop acts under the direction of the stake president in exercising the keys he holds without going beyond the bounds set. You will not see him conferring keys on the deacon’s quorum president of the next ward.
There is order within the priesthood, both on earth and in heaven. “This, then, is the nature of the Priesthood,” taught Joseph Smith, “every man holding the Presidency of his dispensation, and one man holding the Presidency of them all, even Adam; and Adam receiving his Presidency and authority from the Lord” (Teachings of the Prophet Joseph Smith, page 169). And again, “The keys have to be brought from heaven whenever the Gospel is sent. When they are revealed from heaven, it is by Adam’s authority” (page 157).
Your intuition was correct in that Peter, James, and John restored to Joseph and Oliver two sets of keys: the keys of the Melchizedek Priesthood (as related by John the Baptist), and the keys of the kingdom (as stated in the Doctrine and Covenants). Rather than confer the keys of the Aaronic Priesthood themselves, they directed John the Baptist to do so. Ultimately, their authority to dispense keys, along with similar authority held by Moses, Elias, and Elijah, is a stewardship given them by Adam.