Sure Aal-i-Imraan

3:165

أَوَلَمَّآ أَصَٰبَتْكُم مُّصِيبَةٌۭ قَدْ أَصَبْتُم مِّثْلَيْهَا قُلْتُمْ أَنَّىٰ هَٰذَا ۖ قُلْ هُوَ مِنْ عِندِ أَنفُسِكُمْ ۗ إِنَّ ٱللَّهَ عَلَىٰ كُلِّ شَىْءٍۢ قَدِيرٌۭ

Ist es nicht (so), daß, als euch ein Unglück traf, obwohl ihr (den Feind) mit einem zweimal so großen getroffen hattet, ihr sagtet: "Woher kommt das?" Sag: Es kommt von euch selbst. Gewiß, Allah hat zu allem die Macht.

Tafsir 3:165

O believers, when disaster struck you at Uḥud, and many of you were killed, and you had beforehand afflicted on your enemies a disaster twice as great in terms of those killed and captured on the day of Badr; why then did you ask where this calamity came from? You claimed that since you are believers and the Prophet of Allah is with you, it should not have occurred. Tell them, O Prophet, that what happened to them came from their own actions and disobedience. Allah is powerful over all things, giving victory to whomever He wills, and leaving whomever He wills