وَعَلِمَ مَا هُمْ عَامِلُونَ قَبْلَ أَنْ يَخْلُقَهُمْ
Allah knew what they would do before He created them.
Neither good deeds nor acts of disobedience are concealed from Him. However, knowing an act beforehand and a servant choosing to perform it are distinct matters.
Divine knowledge is perfect, while the servant’s responsibility for action remains.