Jihad and terrorism are not the same thing. Jihad is one of the main features of Islam. On the other hand terrorism is Haraam and illegal in Islam. Jihad is striving for self improvement and for establishing peace, security and eternal welfare.
عن نافع عن ابن عمر أتاه رجلان في فتنة ابن الزبير فقالا ” إن الناس ضيعوا وأنت ابن عمر وصاحب النبي فما يمنعك أن تخرج فقال يمنعني أن الله حرم دم أخي. قالا ألم يقل الله (فقاتلوهم حتى لا تكون فتنة)، فقال قاتناهم حتى لم تكن فتنة وكان الدين لله فأنتم تريدون أن تقاتلوا حتى تكون فتنة ويكون الدين لغير الله. وزاد عثمان بن صالح عن أبي وهاب قال أخبرني فلان وحيوة بن شريح عن بكر بن عمرو والمعافري أن بكير بن عبد الله حدثه عن نافع أن رجلاً أتى ابن عمر فقال يا أبا عبد الرحمن ما حملك على أن تحج عاما وتعتمر عاما وتترك الجهاد في سبيل الله وقد علمت ما رغب الله فيه. قال يا ابن أخي بني الإسلام على خمس إيمان بالله ورسوله والصلاة الخمس وصيام رمضان وأداء الزكاة وحج البيت. قال يا أبا عبد الرحمن ألا تسمع ما ذكر الله في كتابه وإن طائفتان من المؤمنين اقتتلوا بأصلحوا بينمها… وقاتلوهم حتى لا تكون فتنة. قال فعلنا على عهد رسول الله وكان الإسلام قليلاً فكان الرجل يفتن في دينه إما قتلوه وإما يعذبوه حتى كثر الإسلام فلم تكن فتنة”.
Narrated by Nafi:
During the affliction of Ibn Az-Zubair, two men came to Ibn Umar and said, “The people are lost, and you are the son of Umar, and the companion of the Prophet, so what forbids you from coming out?”. He said, “What forbids me is that Allah has prohibited the shedding of my brother’s blood”. They both said, “Didn’t Allah say, ‘And fight them until there is no more affliction?”. He said, “We fought until there were no more afflictions and the worship is for Allah (Alone while you want to fight until there is affliction and until the worship becomes worship for other than Allah”. Nafi Narrated (through another group of sub-narrators): A man came to Ibn Umar and said, “O Abu Abdur Rahman! What made you perform Hajj in one year and Umra in another year and leave the Jihad for Allah’s cause though you know how much Allah recommends it?”. Ibn Umar replied, “O son of my brother! Islam is founded on five principles, i.e. belief in Allah and His Apostle, the five compulsory prayers, the fasting of the month of Ramadan, the payment of Zakat, and the Hajj to the House (of Allah).” The man said, “O Abu Abdur Rahman! Won’t you listen to what Allah has mentioned in His Book: ‘If two groups of believers fight each other, then make peace between them, but if one of them transgresses beyond bounds against the other, you all fight against the one that transgresses. (49.9) and:- “And fight them till there are no more afflictions (i.e. no more worshiping of others besides Allah).” Ibn Umar said, “We did it, during the lifetime of Allah’s Messenger (PBUH) when Islam had only a few followers. A man would be put to trial because of his religion; he would either be killed or tortured. But when the Muslims increased, there was no more affliction or oppression.” {Bukhari:2/648}.
عن عمران بن حصين قال أتى نافع بن الأزرق وأصحابه فقالوا هلكت يا عمران. قال ما هلكت، قالوا بلى، قال ما الذي أهلكني؟ قالوا قال الله (وقاتلوهم حتى لا تكون فتنة ويكون الدين كله لله). قال قد قاتلناهم حتى نفيناهم فكان الدين كله لله. إن شئتم حدثتكم حديثاً سمعته من رسول الله. قالوا: وأنت سمعته من رسول الله؟ قال نعم شهدت رسول الله وقد بعث جيشاً من المسلمين إلى المشركين فلما لقوهم قاتلوهم قتالاً شديداً فمنحوهم أكتافهم فحمل رجل من لحمتي على رجل من المشركين بالرمح فلما غشيه قال أشهد أن لا إله إلا الله إني مسلم فطعنه فقتله. فأتى رسول الله فقال يا رسول الله هلكت، قال وما الذي صنعت؟ مرة أو مرتين فأخبره بالذي صنع. قال له رسول الله فهلا شققت عن بطنه فعلمت ما في قلبه قال يا رسول الله لو شققت بطنه أكنت أعلم ما في قلبه؟ قال فلا أنت قبلت ما تكلم به ولا أنت تعلم ما في قلبه. قال فسكت عنه رسول الله فلم يلبث إلا يسيراً حتى مات فدفناه فأصبح على ظهر الأرض فقالوا لعل عدواً نبشه فدفناه ثم أمرنا غلماننا يحرسونه فأصبح على ظهر الأرض فقلنا لعل الغلمان نبشوا فدفناه ثم حرسناه من أنفسنا فأصبح على ظهر الأرض فألقيناه في بعض تلك الشعاب.
وعن عمران بن الحصين قال بعثنا رسول الله في سرية فحمل رجل من المسلمين على المشركين فذكر الحديث وزاد فنبذته الأرض فأخبر النبي وقال إن الأرض لتقبل من هو أشر منه ولكن الله أحـب أن يريكم تعظيم حرمة لا إله إلا الله.
It was narrated from Sumait bin Sumair, that ‘Imran bin Husain said:
“Nafi’ bin Azraq and his companions came and said: ‘You are doomed, O ‘Imran!’ He (‘Imran) said: ‘I am not doomed.’ They said: ‘Yes you are.’ I said: ‘Why am I doomed?’ they said: ‘Allah says: “And fight them until there is no more Fitnah (disbelief and polytheism, i.e., worshipping others besides Allah), and the religion (worship) will be all for Allah Alone.” {8:39}. He said: ‘We fought them until they were defeated and the religion was all for Allah Alone. If you wish, I will tell you a Hadith that I heard from the Messenger of Allah (PBUH).’ They said: Did you (really) hear it from the Messenger of Allah (PBUH)?. He said: ‘Yes I was with the Messenger of Allah (PBUH) and he had sent an army of the Muslims to the idolaters. When they met them they fought them fiercely, and they (the idolaters) gave them their shoulders (i.e, turned and fled). A man among my kin attacked an idolater man with a spear, and when he was defeated he said: “I bear witness that none has the right to be worshipped but Allah, I am a Muslim.” But he stabbed him and killed him. He came to the Messenger of Allah (PBUH) and said: “O Messenger of Allah, I am doomed.” He said “What is it that you have done?” one or two times. He told him what he had done and the Messenger of Allah (PBUH) said to him: “Why didn’t you cut open his belly and find out what was in his heart.” He said: “You did not accept what he said, and you could not have known what was in his heart!”. The Messenger of Allah (PBUH) remained silent concerning him (that man), and a short while later he died. We buried him, but the following morning he was on the surface of the earth. They said: “Perhaps an enemy of his disinterred him”. So we buried him (again) and told our slaves to stand guard. But the following morning he was on the surface of the earth again then we said: ‘Perhaps the slaves dozed off’. So we buried him (again) and stood guard ourselves, but the following morning he was on the surface of the earth (again). So we threw him into one of these mountain passes.’’’
It was narrated from Sumait, from ‘Imran bin Husain who said:
“The Messenger of Allah (PBUH) sent us on a campaign, and a Muslim attacked an idolater”. And he mentioned the Hadith and added: “And the earth cast him out. The Prophet (PBUH) was told about that and he said: ‘The earth accepts those who are worse than him, but Allah wanted to show you how great is the sanctity of La ilaha illallah’’’ {Ibne Mazah: 3930}
Self-improvement with positive qualities through amending negative emotions is mentioned as the greatest Jihad.
روى البيهقي في كتاب الزهد عن جابر قال “قدم رسول الله قوم غزاة فقال عليه السلام قدمتم خير مقدم من الجهاد الأصغر إلى الجهاد الأكبر. قيل وما الجهاد الأكبر؟ قال مجاهدة العبد هواه”. وروى النسائي في كتاب الكنى: قالوا وما الجهاد الأكبر قال جهاد القلب.
It was narrated that the Prophet (PBUH), said to his companions when they returned from a military campaign, “We have come back from the lesser jihad to the greater jihad”. They said, “Is there any greater jihad than jihad against the kuffar?” he said, “Yes, jihad al-nafs (jihad against the self)”. {Baihaqi, Nasayi}.
Without purifying intention of pleasing Allah, guiding peple to right path and good, it is never considered as Jihad;
عن أبي موسى الأشعري أن رجلاً أعرابياً أتى النبي فقال يا رسول الله الرجل يقاتل ليذكر والرجل يقاتل ليرى مكانه فمن في سبيل الله. قال رسول الله من قاتل لتكون كلمة الله هي العليا فهو في سبيل الله. (صحيح مسلم، كتاب باب من قاتل لتكون كلمة الله هي العليا فهو في سبيل الله).
It has been narrated on the authority of Abu Musa Ash’ari that a desert Arab came to the Prophet (PBUH) and said:
Messenger of Allah, one man fights for the spoils of war; another fights that he may be remembered; another fights that he may use his (high) position (achieved as a result of his valor in fighting). Which of these is fighting in the cause of God? The Messenger of Allah (PBUH) said: Who fights so that the word of Allah is exalted is fighting in the way of Allah. {Muslim: 1904}
Just like surgical procedure required to protect the whole body in case of decaying human organs, similarly, Qital or armed warfare is made permissible in order to save whole mankind from terror and fright. {see chapters of Jihad in the books of hadith}.
It is mentioned in the Quran;
(وَلَوْلَا دَفْعُ اللَّهِ النَّاسَ بَعْضَهُم بِبَعْضٍ لَّهُدِّمَتْ صَوَامِعُ وَبِيَعٌ وَصَلَوَاتٌ وَمَسَاجِدُ يُذْكَرُ فِيهَا اسْمُ اللَّهِ كَثِيرًا وَلَيَنصُرَنَّ اللَّهُ مَن يَنصُرُهُ إِنَّ اللَّهَ لَقَوِيٌّ عَزِيزٌ) ( الحج: 40)
For had it not been that Allah checks one set of people by means of another, monasteries, churches, synagogues, and mosques, wherein the Name of Allah is mentioned much would surely have been pulled down. Verily, Allah will hold those who help His (Cause). Truly, Allah is All-Strong, All-Mighty. {Sura Hajj:40}.
However, even such Qital or armed warfare is allowed subject to many more conditions. any transgression or violation of such condition is strictly prohibited in this regard. It is stated in the Quran:
(وَلَا تَعْتَدُواإِنَّاللَّهَلَايُحِبُّالْمُعْتَدِينَ) (المائدة 87)
And transgress not. Verily, Allah does not like the transgressors. {Sura Maeda:87}
(وَإِنْ عَاقَبْتُمْ فَعَاقِبُوا بِمِثْلِ مَا عُوقِبْتُم بِهِوَلَئِنصَبَرْتُمْلَهُوَخَيْرٌلِّلصَّابِرِينَ) (النحل:126)
And if you punish the {an enemy, O believers}, punish with an equivalent of that with which you were harmed. But if you are patient – it is better for those who are patient. {Sura Nahl: 126}