Muslim ibn Yasar Juhanni reported that Sayyidina Umar (RA) ibn Khattab was asked about this verse: "And when your Lord brought forth from the children of Adam, that is, from their backs, their progeny, and made them testify about themselves, ‘Am I not your Lord?’ They said, “Of course, You are, we affirm”, lest you should say on the Day of Doom, “We were ignorant of this." (7: 172)
Umar (RA) ibn Khattab said: I had heard that Allah’s Messenger (SAW) was asked about it, so he said, “Allah created Adam then stroked his back with His Right Hand and brought forth from it his offspring, saying, ‘I have created them for Paradise and they will perform what the inhebitants of Paradise do’. Then He stroked his back and brought forth from it his offspring saying, ‘I have created them for the Fire. They will perform what the dwellers of Hell do.’“ A man asked ‘Then why perform the deeds, O Messenger of Allah (SAW) ?’“So, Allah’s Messenger (SAW) said, “When Allah creates a slave for Paradise, He gets him to do deeds of those who will go to Paradise till he dies doing deeds of those who dwell in Paradise. So Allah admits him to Paradise. And, when Allah creates a slave for Hell, He gets him to do deeds of the people of Hell till he dies doing deeds of those who dwell in Hell. So Allah admits him to Hell.”
[Ahmed 311]