The expedition of Nakhla was made just to collect information on what the Quraysh were doing and to report back to the Prophet (p) accordingly.
Read also: Did Quraysh Persecute Muslims When They Fled To Madinah?
The Prophet (p) sent Abdullah Ibn Jahsh to Nakhlah with a letter and ordered him not to open it for at-least two days after which he could open and read and follow its instructions. When the time came, Abdullah ibn Jahsh opened the letter and set forth to Nakhlah. This is reported in Tabari and Ibn Ishaq.
EXPEDITION OF NAKHLAH…
“They question thee with regard to warfare in the sacred month. Say: warfare therein is a great (transgression), but to turn (man) from the path of Allah…’ This was revealed because the Messenger of God sent a detachment of seven men under the command of Abd’Allah b. Jahsh al-Asadi, consisting of Ammar b. Yasir, Abu Hudhayfah b. Utbah b. Rabi’ah, Sa’d b. Abi Waqqas, Utbah b. Ghazwan al-Sulami the confederate of the Banu Nawfal, Suhayl b. Bayda, Amir b. Fuhayrah and Waqid b. Abd’Allah a;-Yarbu’I the confederate of Umar b. al-Khattab.
He wrote a letter (which he gave) to Ibn Jahsh, ordering him not to read it until he halted at Batn Malal. When he halted at Batn Malal, he opened the letter, which read, ‘March until you halt at Batn Nakhlah.’ He said to his companions, ‘Whoever desires death, let him go on and make his will, I am making my will and acting on the orders of the Messenger of God.’
He went on, and Sa’d b. Abi Waqqas and Utbah b. Ghazwan, who had lost their riding camel, stayed behind. They went to Buhran in search of it, while Ibn Jahsh went to Batn Nakhlah.
Suddenly he encountered al-Hakam b. Kaysan, Abd’Allah b. Mughirah, al-Mughirah b. Uthman, and Amr b. al-Hadrami. They fought and took al-Hakam b. Kaysan and Abd’Allah b. al-Mughira captive, while al-Mughirah escaped and Amr al-Hadrami was killed by Waqid b. Abd’Allah.” 
“THE EXPEDITION OF ANDULLAH B. JAHSH AND THE COMING DOWN OF ‘THEY WILL ASK YOU ABOUT
THE SACRED MONTH’
“The Apostle sent Abdullah b. Jahsh b. Ri’ab al-Asadi in Rajab on his return from the first Badr. He sent with him eight emigrants, without any of the Ansar. He wrote for him a letter, and ordered him not look at it until he journeyed for two days, and to do what he was orded to do, but not to put pressure in any of his companions. The names of the eight emigrants were, Abu Hudhayfa, Abdullah b. Jahsh, Ukkasha b. Mihsan, Utba b. Ghazwan, Sa’d b. Abu Waqqas, Amir b. Rabi’a, Waqid b. Abdullah, and Khalid b. al-Bukayr. When Abdullah had travelled for two days he opened the letter and looked into it, and this is what it said, ‘When you have read this letter of mine proceed until you reach Nakhla between Mecca and Al-Ta’if. Lie in wait there for Quraysh and find out for us what they are doing. ’Having read the letter he said, ‘To hear is to obey.’ Then he said to his companions, ‘The apostle has commanded me to go to Nakhla to lie in wait there for Quraysh SO AS TO BRING NEWS OF THEM. He had forbidden me to put pressure on any of you, so if anyone wishes for martyrdom let him go forward, and he who does not, let him go back; as for me I am going on as the Prophet has ordered.’ So he went on, as did all his companions, not one of them fell back. He journeyed along the Hijaz until at a mine called Bahran above al-Furu, Sa’d and Utba lost the camel which they were riding by turns, so they stayed behind to look for it, while Abdullah and the rest of them went on to Nakhla. A caravan of Quraysh carrying dry raisins and leather and other merchandise of Quraysh passed by them, Amr b. al-Hadrami, Uthman b. Abdullah b. al-Mughira and his brother Naufal the Makhzumites, and al-hakam b. Kaysan, freedman of Hisham b. al-Mughira being among them.
“When the caravan saw them they were afraid of them because they had camped near them.
Ukkasha, who had shaved his head, looked down on them, and when they saw him they felt safe and said, ‘They are pilgrims, you have nothing to fear from them.’ The raiders took council among themselves, for this was the last day of Rajab, and they said, ‘If you leave them alone tonight they will get into the sacred area and will be safe from you; and if you kill them, you attack them. Then they encouraged each other, and decided to kill as many as they could of them and take what they had. Waqid show Amr b. al-Hadrami with an arrow and killed him, and Uthman and al-Hakam surrended Naufal escaped and eluded them. Abdullah and his companions took the caravan and the two prisoners and came to Medina with them. One of Abdullah’s family mentioned that he said to his companions, ‘A fifth of what we have belongs to the apostle.’ So he set apart for the apostle a fifth of the caravan, and divided the rest among his companions. When they came to the apostle, he said,‘I did not order you to fight in the sacred month,’and he held the caravan and the two prisoners in suspense and refused to take anything from them. When the apostle said that, the men were in despair and thought they were doomed. Their Muslim brethren reproached them for what they had done, and the Quraysh said, ‘Muhammad and his companions have violated the sacred month, shed blood therein, taken booty, and captured men.’ The Muslims in Mecca who opposed them said that they had done it in Sha’ban. The Jews turned this raid into an omen against the apostle. Amr b. al-Hadrami whom Waqid had killed they said meant ‘amarati’l’-harb (war has come to life), al-Hadrami meant hadarati’l’harb (war is present), and Waqid meant waqadatai’l’-harb (war is kindled); but God turned this against them, not for them, and when there was much talk about it, God sent down his apostle: “They will ask you about the sacred month, and war in it. Say, war therein is a serious matter, but keeping people from the way of God and disbelieving in Him and in the sacred mosque and driving out His people there from is more serious with God. i.e, If you have killed in the sacred month, they have kept you back from the way of God with their unbelief in Him, and from the sacred mosque, and have driven you from it when you were its people. This is a more serious matter with God than the killing of those of them whom you have slain. And seduction is worse than killing.’ i.e., they used to seduce the Muslim in his religion until they made him return to unbelief after believing, and that is worse with God than killing. And they will not cease to fight you until they turn you back from your religion if they can’ i.e., they are doing more heinous acts than that contumaciously. And when the Quran came down about that and God relieved the Muslims of their anxiety in the matter…” 
Reading the above two sources, one realizes that the Prophet (p) did not sent his companions to “raid” or to attack anyone. They were sent to gather information on what the Quraysh (the enemy) were doing. Nothing else!
I highlighted the two reports because critics try to claim that when Muslims fled to Medina their lives were safe and that there was no threat from the Quraysh.
But if that was the case, as the critics assume, then why was that one of the leading companions, heading this expedition told the other companions that if they followed along, they would die as ‘martyrs’? The Companion, Abd’Allah b. Jahsh al-Asadi, clearly pointed out the sole purpose of the expedition when he said:
‘‘The Apostle has commanded me to go to Nakhla to lie in wait there for Quraysh SO AS TO BRING NEWS OF THEM. He had forbidden me to put pressure on any of you, so if anyone wishes for martyrdom let him go forward, and he who does not, let him go back” (Ibn Ishaq page 286 – 288).
Remember, they didn’t even arrive in the vicinity of Nakhlah when he said that, and Abd’Allah b. Jahsh al-Asadi started telling his companions that they could go back if they wanted since where he was leading to might cause their being killed (martyred).
Another question critics need to answer is, why did the Prophet (p) send his companions on an expedition to monitor and gather information what the Quraysh (enemy) were doing, if everything was all jolly between themselves? These historical reports shows that the Quraysh were at war with the Muslims. The reports show that if the Muslims were to be seen, they would be killed on sight. This incident occurred before the battle of Badr.
Furthermore, when one reads the above two reports, when the Companions returned to the Prophet (p) on what they did, they were rebuked by Prophet Muhammad (p) and other Companions who didn’t participate in this journey, on failing to act exactly according to the word given them by the Prophet, to gather information on the enemy, nothing else!
Although the Prophet (p) was against what they did, God sent down revelation to Prophet Muhammad (p) that what the Companions did to the enemy was justified for the following reasons as the verse states:
“They ask you about the sacred month – about fighting therein. Say, “Fighting therein is great [sin], but averting [people] from the way of Allah and disbelief in Him and [preventing access to] al-Masjid al-Haram and the expulsion of its people there from are greater [evil] in the sight of Allah. And fitnah is greater than killing. And they will continue to fight you until they turn you back from your religion if they are able. And whoever of you reverts from his religion [to disbelief] and dies while he is a disbeliever – for those, their deeds have become worthless in this world and the Hereafter, and those are the companions of the Fire, they will abide therein eternally.” (Qur’an 2:217)
From the above verse, we gather the following crimes committed by Quraysh:
1. Preventing people from Believing in Islam.
2. Stopping believers going to the Holy Mosque (Masjid al-Haram).
3. Driving believers out of Mecca, forcibly displacing Muslims.
4. Persecution is worse than killing – meaning one rather die than be continuously persecuted by the Quraysh.
5. “And they will continue to fight you until they turn you back from your religion”, here is very strong reminder to Muslims 1400 years ago, that the disbelievers of Makkah will not leave Muslims alone until they abandon their current faith (Islam). That the disbelievers of Makkah will continuously persecute, kill Muslims until they leave Islam.
When we read these 5 points from the verse, it is clear that the Muslims had every right to fight back against them.
One cannot accuse the Muslims of being the bad ones for attacking the enemy, when the enemy were the first to attack, continuously persecuting and killing Muslims. Even when the Muslims emigrated away from Quraysh’s persecution, the enemy wrote letters to where the Muslims fled, ordering the expulsion of the persecuted Muslim community out of Medina. This is has been written about in more detail here: ‘Quraysh Threatened Madinah’s Leaders For Giving Sanctuary To Muslims‘.
The Muslims were persecuted for over ten long years in Mecca. As I mentioned before, when the Muslims were exiled, fleeing from persecution in Makkah to Medina, the Quraysh wrote letters demanding the Medinan leaders to drive out Muslims or else they will come and kill everyone there.
What were these continuously persecuted and threatened Muslims supposed to do? Sit back and wait for the Quraysh to finish them off before thinking of fighting back?
In short, the Muslims fighting back the Quraysh enemy, 1400 years ago were justified given the reasons pointed out above.
 The History of al-Tabari: The Foundation of the Community: Muhammad at al-Madina: volume 7, page 21 – 22
 Ibn Ishaq’s Sirat Rasul Allah – The Life of Muhammad [Translated by A. Guillaume], page 286 – 288