—for example, “Be mindful of Allah and keep company with the truthful”⦗Q 9:119⦘; “Muhammad is the Messenger of Allah, and those who are with him are firm against the disbelievers”⦗Q 48:29⦘; and “Those who believed later, then migrated and strove along with you—such are of you”⦗Q 8:75⦘. The word maʿ (“with”) in the Quran is used in both a universal and a particular sense.
The universal sense appears in this verse and in the verse from Sūrat al-Mujādalah: “Do you not see that Allah knows whatever is in the heavens and whatever is on the earth? No secret counsel takes place among three without Him being their fourth, nor among five without Him being their sixth, nor fewer than that nor more, but that He is with them wherever they may be. Then He will inform them on the Day of Resurrection of what they did. Surely Allah is fully aware of everything”⦗Q 58:7⦘. He opens the statement with knowledge and concludes it with knowledge. For that reason Ibn ʿAbbās, al-Ḍaḥḥāk, Sufyān al-Thawrī, and Aḥmad ibn Ḥanbal said: “He is with them by His knowledge.”
The particular sense of maʿiyyah is found in His words, “Indeed Allah is with those who are mindful of Him and those who excel”⦗Q 16:128⦘; in His address to Moses, “I am with you both; I hear and I see”⦗Q 20:46⦘; and in His words, “When he said to his companion, ‘Do not grieve; Allah is with us’”⦗Q 9:40⦘—meaning the Prophet, peace and blessings be upon him, and Abū Bakr, may Allah be pleased with him. Thus He is with Moses and Aaron but not with Pharaoh; with Muhammad and his companion but not with Abū Jahl and the rest of his enemies; and with those who are mindful and who excel, but not with the wrongdoers and the aggressors.