Sure Al-Anfaal

8:67

مَا كَانَ لِنَبِىٍّ أَن يَكُونَ لَهُۥٓ أَسْرَىٰ حَتَّىٰ يُثْخِنَ فِى ٱلْأَرْضِ ۚ تُرِيدُونَ عَرَضَ ٱلدُّنْيَا وَٱللَّهُ يُرِيدُ ٱلْءَاخِرَةَ ۗ وَٱللَّهُ عَزِيزٌ حَكِيمٌۭ

Es steht keinem Propheten zu, Gefangene zu haben, bis er (den Feind überall) im Land schwer niedergekämpft hat. Ihr wollt Glücksgüter des Diesseitigen, aber Allah will das Jenseits. Allah ist Allmächtig und Allweise.

Tafsir 8:67

It is not right for a prophet to take captives from the disbelievers who fight against him until he kills many of them, so that this makes other disbelievers fear fighting him. By taking captives from Badr, O believers, you want to receive ransom, but Allah wants the Afterlife for you, which is gained by making religion victorious and powerful. Allah is Mighty in His essence, His attributes and in His domination. Nothing can overcome Him. He is Wise in His decree and sacred laws.