In the modern world, we often hear two very different stories regarding the Islamic doctrine of jihad. From anti-Islamic sources and so-called Jihadist terror groups, we hear that jihad is an endless war against all non-Muslims in which all infidels are targets. On the other hand, some say that jihad is entirely a defensive concept, or even that jihad exists only as an internal struggle. While the latter of these two arguments contains a good deal more truth than the former, neither of the two truly explain jihad in its entirety.
To understand jihad, we need to first understand the context in which Islam developed. Before and even after Islamization, many warlike Bedouin tribes called Arabia their home. These tribes often raided for a large portion of their livelihood and fought with each other for territory. Early Muslims, when expanding their territory, often came into contact with hostile pagans. Early in Islam’s development, Muslims needed to use violence to survive in a world that was deeply hostile towards them. Out of this context, the concept of two opposing factions, the Dar al-Islam and the Dar al-Harb, formed. The Dar al-Islam, or “House of Islam,” constitutes every part of the world with a Muslim ruler and the Dar al-Harb, or “House of War,” is everywhere that non-Muslims rule. We can easily see how this view of the world might develop in the hostile, pagan Arabian peninsula. Also, Arabia retained a strong heroic tradition captured in orally-transmitted poems stemming from the almost constant violence and vengeance-based system of clans.  These old ideals of heroic warfare blended with Islamic concepts of piety in the first years of Muslim development.
Before speaking more at length on jihad as warfare, it is important to recognize that jihad always carried both a military and a non-military connotation. The word jihad, in Arabic, means simply “striving.”  Though many different concepts of jihad exist, almost all divide it into two different concepts: Greater and Lesser Jihad. Greater Jihad refers to that internal struggle for righteousness mentioned earlier, and most Islamic scholars consider it far more important than Lesser Jihad. Lesser Jihad, on the other hand, constitutes the external struggle on behalf of Islam, including but not limited to warfare. For instance, convincing non-Muslims to convert to Islam counts just as much as Lesser Jihad as battling a non-Muslim ruler.
Lesser Jihad in the military context eventually developed into a subject of great scholarly and legal debate. Scholars often disagreed on what did and did not constitute jihad, and even here it is impossible to cover all the different concepts and ideas. In the Quran, one can make the argument that jihad only ever appears militarily in the context of self-defense.  However, Caliph Omar called his war of conquest against the Sassanids jihad as well, forever cementing jihad as a mechanism of conquest and offensive war.  Similarly, in ‘Ali and Ayesha’s civil war over the validity of ‘Ali’s caliphate, the two each called jihad on each other, marking the first instance in which Muslims called jihad on other Muslims.  Since this point, most scholars agreed that other Muslims constituted valid targets of jihad as long as they were rebels or outlaws. Less often, scholars even argued that Muslim subjects rebelling against tyrannical or unjust Muslims rulers engaged in jihad. On top of these examples from early Islamic history, many Muslim scholars also made use of Greek, Persian, and Indian scholarship relating to ideas of just wars and incorporated them into the Islamic legal doctrine of jihad. 
During the medieval era, jihad scholarship grew to increasing prominence. The concept fell out of practice after the general end of Islam’s territorial expansions, and with the shift of power from the Rashidun Caliphate, as it is called by Sunni Muslims, to the dynastic Umayyad and Abbasid Caliphates, which held far less religious power. However, with the influx of crusaders from the Latin West conquering and settling in the Middle East, Muslims began to see this invasion as an assault on Islam as a whole.  Medieval Islam began to formalize the concepts of jihad that still exist today, though warped slightly for modern consumption. In the Middle Ages, two different ideas of the targets of jihad came into existence. The first believed that all Muslims warriors, rulers, and anyone of fighting shape, had the obligation to undertake constant offensive jihad against all non-Muslim polities. This concept required them to fight until the entire world fell beneath the Dar al-Islam. Though scholars circulated this idea, Muslim rulers never truly took it up, as it required to put off their more mundane wars against other Muslim neighbors, the constant upkeep of expensive standing armies, and conflict along long fronts that never closed. The other, far more popular concept only required Muslims to take up jihad in defense of Islam. It is important to note, however, that this version of jihad also allowed for offensive wars, it just did not see them as an obligation.
Many rules governed the conduct of jihad, who could be targeted, and what ought to be done with conquered peoples. Firstly, for a true jihad, a religious authority, preferably the caliph, needed to call it. This rule, however, was often ignored by ambitious rulers of Muslim polities wishing to justify their conquests.  Those taking part in the war needed to fight for the right reasons—spiritual benefit and religious obligation rather than personal gain of either power or wealth. Whether or not those fighting in most of the battles followed these rules, we can be almost certain that rulers of Muslims polities saw the lands and power they could gain by conquering non-Muslim states through jihad before they set out. Regarding conquered peoples, jihad scholars mostly agreed that all non-Muslims with holy texts, called “The People of the Book,” enjoyed protected status and should be allowed to practice their religions even after being conquered by Muslims. This group included Christians, Jews, Zoroastrians, and Hindus. Pagans, however, should be converted by the sword. Interestingly, all scholars agreed that armies engaged in jihad were forbidden from attacking non-combatants, including women, children, and, depending on the scholar, men not engaged in combat. This proscription was so strong that it affected the sort of weapons jihad armies could use. Mangonels, catapults, and other siege weapons that hurled stones all became considered illegal weapons, as they killed indiscriminately and might accidentally kill civilians. Though it is important to note that many medieval jihad armies ignored or simply were ignorant of some of these proscriptions, the concept that modern terrorists are “jihadists,” clashes entirely with this principle. How can people whose military strategy centers completely around targeting civilians truly be engaged in jihad?
After the end of the crusades, jihad once again fell out of favor in Muslim circles until the early 18th century. A prominent Muslim theologian named Abdul ibn Wahhab proclaimed that Muslims strayed from their roots and needed purification. He allied with the growing and powerful Saudi family, and with their political power his ideals grew. His theology formed around two points, “the importance of tawhid, or “unity, that is, the singleness and unity of God; and second, the fallacy of shirk, the idea that anyone or anything shared in God’s divinity to even the smallest degree.”  Saudi chieftains and other followers extended this concept to include the importance of law to Islam, and the importance of jihad to upholding this law.  They saw Muslims who did not fully commit themselves to this law as the greatest threats to Islam, rather than non-Muslims.  These fell into four distinct categories: slackards, apostates, hypocrites, and innovators. Wahhabism decreed that slackards needed punishment, in order to show other Muslims that failing to follow law had consequences, that apostates and hypocrites needed death, and that offensive jihad against innovators, such as Shiite Muslims or Sufis, was obligatory.  Most modern terrorist organizations draw from radical variants of Wahhabism.
Understanding jihad does not allow us to fully understand Islam. It is a far too complex and developed religion for any one piece of it to fully explain it, especially one as peripheral as jihad. It is, however, important for understanding modern terrorist organizations and Wahhabist nations such as Saudi Arabia and many of the other Gulf States, as well as understanding why the phraseology of referring to terrorist organizations as “Islamic,” is deeply and fatally incorrect. Islamic law and scholarship goes directly against many of the practices of these organizations, even in their most bellicose forms. A medieval scholar who deeply believed that Muslims ought to battle with the entire world until Muslims ruled it completely would likely be appalled with these organizations blatant targeting of civilians and other Muslims. When viewing ISIS’s systematic execution of non-Muslims such as Yazidis and Christians, it is important to recognize that, by doing so, they are violating Islamic law and rendering their war no longer a true jihad. Many call the actions of these organizations “medieval” as a stand-in for barbaric, but Muslims from the actual Middle Ages would have been just as appalled at their actions as we are today.
 Bonner, "Jihad in Medieval Islam.
 Ansary, Destiny Disrupted.
 Carlos Domingues, Medieval Warfare, Volume 4, "Leader of Jihad."
A large amount of the scholarship here comes from a lecture given by Dr. Janna Bianchini on 10/9/17.