In this background...
In this background, as soon as he realized that his prayer included both the believers and the unbelievers, he added the proviso, “such of them as believe...”, although he was well aware that, according to the social structure of this world, sustenance could not be given only to the believing group, to the exclusion of the unbelievers; yet he qualified his prayer. Even so, Allah knows better how He should decide about His creatures and what He should decree concerning them.
Therefore, Ibrahim's prayer was granted for the believers, and was extended to cover the unbelievers also. The reply given to Ibrahim (a.s.) implies that Allah would give them sustenance according to the system He has created in this world; in other words, believers and unbelievers both would be given their livelihood, because restricting it to the believers would entail unnecessarily…