وما ظلمناهم
We wronged them not,
This means, "When We destroyed them.''
ولكن ظلموا أنفسهم
but they wronged themselves.
their rejecting their Messengers and disbelieving in them.
فما أغنت عنهم آلهتهم
So their gods, profited them (not)...
This is referring to their idols that they used to worship and invoke.
التي يدعون
whom they call upon,
من دون الله من شيء
other than Allah naught,
the idols did not benefit them, nor did they save them when Allah's command came for their destruction.
لما جاء أمر ربك
when there came the command of your Lord,
وما زادوهم غير تتبيب
nor did they add aught to them but destruction.
Mujahid, Qatadah and others said,
"This means loss. Because the reason for their destruction and their ruin was that they followed those false gods. Therefore, they were losers in this life and the Hereafter.''