Allah denounces those who take other gods instead of Him:
(Or have they taken gods from the earth who raise the dead) meaning, can they bring the dead back to life and bring them forth from the earth They cannot do any of that, so how can they make them rivals to Allah and worship them alongside Him Then Allah tells us that if there were another god besides Him, the heavens and the earth would be ruined:
(Had there been therein gods) means, in the heavens and the earth,
(then verily, both would have been ruined.) This is like the Ayah:
(No son did Allah beget, nor is there any god along with Him. Then each god would have taken away what he had created, and some would have tried to overcome others! Glorified be Allah above all that they attribute to Him!) 23:91. And Allah says here:
(Glorified be Allah, the Lord of the Throne, above all that they associate with Him!) meaning, glorified be He above what they say about Him having offspring or partners; glorified and exalted and sanctified be He far above all the lies that they fabricate.
(He cannot be questioned about what He does, while they will be questioned.) He is the Ruler Whose rule cannot be overturned and none can object to it, because of His might, majesty, pride, knowledge, wisdom, justice and subtlety.
(while they will be questioned.) means, He is the One Who will ask His creation about what they did. This is like the Ayah:
(So, by your Lord, We shall certainly call all of them to account. For all that they used to do.) 15:92-93
(And He protects (all), while against Whom there is no protector) 23:88