of a religious nature that has befallen us”—He, glorified is He, made clear that the calamities that befell them were only because of their sins. This refutes those who turned away from obedience to the Messenger, may Allah bless him and grant him peace, lest those calamities befall them; those who professed belief in the Messenger but attributed those calamities to putting his teachings into practice; and those who suffered them while disbelieving in the Messenger and attributed them to what he brought.
Section
The point is that what the Messenger, may Allah bless him and grant him peace, brought is not the cause of any calamity. Obedience to Allah and His Messenger can never be the cause of a calamity. Rather, obedience to Allah and the Messenger entails only that those who obey be rewarded with the good of both this world and the Hereafter. However, calamities may befall those who believe in Allah and His Messenger because of their sins, not because of their obedience to Allah and the Messenger—as happened to them on the day of Uhud because of their sins, not because of their obedience to Allah and His Messenger, may Allah bless him and grant him peace.
Likewise, the trials they underwent in prosperity, adversity, and upheaval were not caused by their faith and obedience themselves. Rather, they were tested through them so that they might rid themselves of the evil within them