The Messenger of Allah ﷺ was asked about the children of the polytheists. He replied, "Allah, when He created them, knew best what they would have done."
سئل رسول الله ﷺ عن أولاد المشركين فقال: الله إذ خلقهم أعلم بما كانوا عاملين.
Bukhari narrated it in the Book of Funerals (1383), and Muslim in the Book of Divine Decree (2660), both through the route of Abu Bishr, from Saeed bin Jubayr, from Ibn Abbas, who mentioned it.