"And he had no authority over them"—this is like His saying: "For you and those you worship, you cannot lead (anyone) away from Him, except him who is to burn in the Hellfire." He means: You cannot lead anyone astray.
His saying: "Except that We might know who believes in the Hereafter"—this is the knowledge of manifestation (the act itself)—"from him who is in doubt of it." The polytheists only denied the Hereafter out of their assumption and doubt. "And your Lord is, over all things, a Guardian," so that He may recompense them in the Hereafter.