Chapter 4, verse 94 was revealed concerning an incident with a man from the Banu Sulaym tribe (Tafsir Ibn Kathir, Tafsir al-Jalalayn, and Asbab Al-Nuzul by Al-Wahidi). This tribe in the past attacked and killed many Muslims (See more here: 1, 2, 3, 4).
Whereas 4:95, was revealed just before setting out to the Battle of Badr (Tafsir Ibn Kathir). This is reported in the following Hadith:
Narrated Miqsam, the freed slave of ‘Abdullah bin Al-Harith: from Ibn ‘Abbas that he said the Ayah: Not equal are those of the believers who sit, except those who are disabled… (4:95) is about Badr and those went out for Badr. At the time of the battle of Badr, ‘Abdullah bin Jahsh and Ibn Umm Maktum said: ‘We are blind O Messenger of Allah! So is there an exemption for us?’ So the following was revealed: Not equal are those of the believers who sit except those who are disabled. But Allah has preferred those who strive hard and fight above those who sit (at home) by a huge reward (4:95). So these were the people who sat behind, that were not disabled: But Allah has preferred those who strive hard and fight, above those who sit (at home) by a huge reward – they are of levels above those who sit among the believers who did not have an excuse.” (Jami` at-Tirmidhi volume 5, Book 44, Hadith 3032)
The battle of Badr took place as of a result of the Quraysh’s continued persecution against the Muslims in Madinah. The Muslims already fled from Makkah to find safe haven in Madinah, once they arrived there, they were once again hounded by the Quraysh for changing their former faith to Islam. Read the following article for more information that the Quraysh continued persecuting Muslims in Madinah, before Badr.
4:94 O you who have believed, when you go forth [to fight] in the cause of Allah , investigate; and do not say to one who gives you [a greeting of] peace “You are not a believer,” aspiring for the goods of worldly life; for with Allah are many acquisitions. You [yourselves] were like that before; then Allah conferred His favor upon you, so investigate. Indeed Allah is ever, with what you do, Acquainted.
4:95 Not equal are those believers remaining [at home] – other than the disabled – and the mujahideen, [who strive and fight] in the cause of Allah with their wealth and their lives. Allah has preferred the mujahideen through their wealth and their lives over those who remain [behind], by degrees. And to both Allah has promised the best [reward]. But Allah has preferred the mujahideen over those who remain [behind] with a great reward
In 4:94 it speaks of those Muslims who set out to fight the hostile enemies, the believers here were commanded to investigate matters. In the early days of Islam, Salaamu Alaykum (peace be upon you) was a recognition that the person was a Muslim. This was used like a password to show that the person greeting was no enemy and only came for peace. Sometimes hostile enemies used to this salutation in order to have safe passage or even infiltrate the community.
This salutation was importance symbol of peace that the person saying it was Muslim most probably. At the time Muslim or non-Muslims Arabs all look a liked. They wore the same kind of clothes and spoke the same language.
As Mawdudi and Muhammed Asad commentary explain, the critical or difficult part was when Muslims were out to fight certain hostile enemies and when they were fought they would shout ‘Asalamu Alaikum’ or say the Shahadah (there is no god worthy of worship Except God), but the Muslims at the time would still go ahead and kill them, because they believed that the enemy merely said these things in order to save their own lives. Even though Prophet Muhammed (p) would admonish those that did this, this occurred often.
Then God Almighty revealed this verse (Q. 4:94) to solve this by stating that Muslims are not allowed to judge another man by declaring himself to be Muslim. One cannot know the reality of their beliefs, the person maybe speaking a lie or telling the truth unless one investigates thoroughly and find out. There may be a chance of letting off a hostile enemy by accepting his words, or killing an innocent man. Anyhow, it is better to let off an enemy by mistake than to take kill an innocent man by mistake (Maududi, Malik Ghulam Farid Tafseer, Maulana Muhammed Ali Tafsir and Muhammad Asad commentary).
In 4:95 it speaks about those of the believers who remained at home, while being disabled and the fighters who strove to fight the enemy Quraysh at the Battle of Badr. At the same time, the verse also addressed those who were not disable, but did not go out to defend the persecuted. Here we are told that those who went out to defend the community, 1400 years ago, will receive bigger reward than others (Jami at-Tirmidhi volume 5, Book 44, Hadith 3032, and Tafsir Ibn Kathir).
Some have claimed and used these verse, twisted it that it “sanctions killing of non-believers”. This is not true. Nowhere in these verses does it endorse or sanction the killing of innocents. As explained, these verses were revealed as a result of the ongoing hostilities and persecution of the Quraysh (and Banu Sulaym) against the Muslims, in Madinah. Read the following article, where we have shown ample of historical evidences that the Quraysh continued hostilities, and persecution against Muslims before battle of Badr: ‘Did Quraysh Persecute Muslims When They Fled To Madinah?‘
Malik Ghulam Farid:
“652. When a people offers peace or shows a peaceful attitude towards Muslims, the latter are enjoined to respect that attitude and refrain from hostilities. Moreover, as the Muslim community at Medina was surrounded by hostile tribes, they were enjoined to presume a person who greeted them with Islamic salutation, to be a Muslim unless proved otherwise by investigation.
653. That is to say, if you hold such a person to be a disbeliever without proper investigation, this would mean that you desire to kill him and take possession of his goods. Such conduct would show that you prefer worldly goods to God’s cause.
654. The verse speaks of two classes of believers:
(1) Those who sincerely accept Islam and them try to live up to its teachings but take no part in the struggle to defend and propagate the Faith. These are, as it were, passive believers- ‘sitters’ as the verse calls them.
(2) Those who not only live up to the teachings of Islam but also vigoursly participate in the work of its propagation. These are active believers who – the ‘strivers’ or Mujahids as they are called. There is, however, a third class of believers who, even though they do not join their brethren in actually fighting disbelievers get an equal reward with those who take part in the actual struggle. They are heart and soul with the Muslims who are Mujahids, wherever the latter go to fight in the cause of God; but their particular circumstances-disease, poverty, etc., do not allow them to join the expeditions in prison.” 
Maulana Muhammad Ali:
“94a. The original word for salutation is Salam (meaning peace). The first word of the Muslim salutation stands therefore for the Muslim salutation. The Muslims were surrounded by enemies on all sides, yet they were told not to presume that every Arab tribe belonged to the enemy camp but were to make an investigation first, whether the tribe was really hostile to Islam. Even when a man belonging to an enemy tribe offered the Muslim salutation, to show that he was a Muslim, he was to be taken as a brother Muslim and could not be dealt with as an enemy. I‘Ab relates a case in which the Muslims while searching for the enemy came upon a man who was tending his goats. The man offered them the Muslim salutation but was killed as he gave no other indication of being a Muslim (B. 65: iv, 18). It was to stop such cases that the revelation came. Incidentally, it lays down the principle that no Muslim can be called a kafir; not even the man whose claim to Islam is borne out only by offering the Muslim salutation. The general tendency among the Muslims to declare each other k å fi r is, however, so strong that even the plain injunction of this verse is set at naught under the pretext that no Jew or Christian or Hindu can be called a Muslim simply because he offers the Muslim salutation. What the verse lays down is not when a person known to us as a Jew or a Christian or a Hindu can be declared to have become a Muslim, but that a Muslim cannot be called a kafir if he gives indication of his being a Muslim simply by offering the Muslim salutation.
94b. The Muslims were forbidden to kill a man merely because he was a disbeliever. This is made clear in Section 12, where it is laid down that only those disbelievers could be killed who fought against the Muslims. But even when a people fought against the Muslims, a man from among them was not to be killed if he gave the slightest indication that he was a Muslim.” 
“119 Sc., “and therefore one of the enemies”. This verse prohibits the treating of non-combatants as enemies and using their supposed unbelief as a pretext for plundering them. The injunction “use your discernment” (tabayyanu) imposes on the believers the duty of making sure, in every case, whether the persons concerned are actively engaged in hostilities or not.
120 Lit., “thus have you [too] been a foretime”. Since the preceding injunction refers to the whole community, it would seem that the above clause, too, bears the same implication: namely, a reference to the time when the Muslim community was, because of its weakness and numerical insignificance, at the mercy of enemies endowed with greater power. Thus, the believers are told, as it were: “Remember your erstwhile weakness, and treat the peacefully-minded among your enemies with the same consideration with which you yourselves were once hoping to be treated.”
121 Lit., “who sit [at home]”- i.e., who do not participate in the struggle in God’s cause, be it physical or moral.
122 The term mujahid is derived from the verb jahada, which means “he struggled” or “strove hard” or “exerted himself”, namely, in a good cause and against evil. Consequently, jihad denotes “striving in the cause of God” in the widest sense of this expression: that is to say, it applies not merely to physical warfare (qital) but to any righteous struggle in the moral sense as well; thus, for instance, the Prophet described man’s struggle against his own passions and weaknesses (jihad an-nafs) as the “greatest jihad” (Bayhaqi, on the authority of Jabir ibn ‘Abd Allah).” 
Classical scholar Imam Fakhr al-Din al-Razi (1149 – 1210) writes in his Tafsir al Kabir on Quran 4:95,
“The Shi’ah say: This ayah proves that Ali bin abi Talib is superior to Abu Bakr, and that is because Ali waged more jihad. So the proportion in which there appears to be a difference in the matter is Abu Bakr was from those who sit back (more) and Ali was from those who stand (to fight more). If it was like that, then it would be necessary that Ali be superior to him due to His Saying,
Allah has preferred those who strive over those who sit back with a tremendous reward.So it is said to them (the Shi’ah): Certainly, the undertaking (of jihad) of Ali was more than the undertaking of Rasulullah. For that, you must impose the same rule of this ayah that Ali be superior to Rasulullah. No intelligent person says this. So if you say: Certainly, the mujahadah of Rasulullah with the kuffar was greater than the mujahadah of Ali with them, because Rasulullah strove against the kuffar with establishment of proofs, proclamation, and eliminating doubt and misguidance. So this jihad is more complete than that jihad. So we say: all of you accept from us his example in the right of Abu Bakr. That is because when Abu Bakr embraced Islam in the earliest (period of nubuwwah), he was occupied in (bringing) Islam to all the people until ‘Uthmân bin Affan, Talha, Zubair, Sa’d bin abi Waqqas and ‘Uthman bin Madh’un embraced Islam at his hands. He would overdo (himself) in encouraging the people in iman (faith) and in the protection of Muhammad with his own self and wealth. Ali during that time was a child. No one embraced Islam from his words and he was not able to protect Muhammad. So the jihad of Abu Bakr was superior to the jihad of Ali from two aspects.
First: That the jihad of Abu Bakr was during the the first period (of nubuwwah) when Islam was at the point of weakness. As for Ali, it only became apparent in Madinah in battles. Islam during that time was strong.
Second: That the jihad of Abu Bakr was by da’wah to Din (religion) and most of those major sahabah (of the ten who were promised jannah) embraced Islam at his hands. This kind of jihad is the occupation of the Nabi. As for the jihad of Ali, then it was by fighting. And there is no doubt that the first is superior than the other.” (Tafsir al-Kabir lir-Razi, by Imam Fakhr al-Din al-Razi, volume 11, page 10, online source, https://www.muftisays.com/forums/33-ahadeeth/10910-going-in-the-path-of-allah-misconception-removed.html)
Don’t forget to follow Discover The Truth on Facebook and Twitter. PLEASE help spread the word by sharing our articles on your favourite social networks.
 The Holy Qur’an – Arabic Text with English Translation & Short Commentary by Malik Ghulam Farid, page 210 – 211
 The Holy Quran Arabic Text with English Translation, Commentary and comprehensive Introduction [Year 2002 Edition] by Maulana Muhammad Ali, page 223
 The Message of The Quran translated and explained by Muhammad Asad, 189 – 190 http://www.usc.edu/schools/college/crcc/private/cmje/religious_text/The_Message_of_The_Quran__by_Muhammad_Asad.pdf