When the Messenger of Allah (peace be upon him) had settled in Medinah, and after Allah had given him help and the believers from the Ansar and Muhajareen, Islam became a nation which its enemies used to lay in wait to attack, looking for any opportunity to eliminate them.
At that time, Allah gave the Muslims the permission to fight, after He used to order them to be patient and forgiving. Allah gave them permission to fight at that time, but He did not make it an obligation on them. Allah (Glory be to Him) says, {Permission (to fight) has been granted to those against whom war has been waged because they have been treated unjustly, and Allah is certainly able to help them} [Surah Al-Hajj: 39].
Allah (Glory be to Him) explained that this permission was to remove falsehood and establish the rituals of Allah. Allah (Glory be to Him) says, {These are the people who, if We give them power in the land, will establish Prayer, pay the obligatory alms, enjoin what is right and forbid what is evil, and the final decision of all affairs is in the hands of Allah} [Surah Al-Hajj: 41]. The permission to fight was limited at the beginning to fighting the disbelievers of Quraish. After that, it developed, expanding as the circumstances changed to become an obligation in fighting all disbelievers. When the permission to fight was revealed, the Messenger of Allah (peace be upon him) decided to increase his control the main trade route that Quraish used to take to Ash-Sham.
The first year involved attacking Quraish’s caravans. The Messenger of Allah (peace be upon him) equipped 8 campaigns, all of which were sent to intercept caravans belonging to Quraish, except one which was a reply to the attack of Kurz ibn Jabir Al-Fihri. These attacks continued from Ramadan in the first year of Hijra (after immigration) until Ramadan in the second year of Hijra [See details of these campaigns and battles in Zaad Al-Ma’ad (Provisions for the Hereafter)].