Short answer. Jihad means to strive or to struggle in God's cause — above all the inner struggle to live rightly. It is not a synonym for "holy war"; armed struggle is one limited, tightly regulated form of it.
Where the idea comes from
In headlines jihad is almost always translated "holy war," and extremist groups have seized the word to dress up their violence in religious language. Both have buried the word's actual meaning.
The word means "to strive"
The Arabic root of jihad means exerting effort, striving, struggling — toward a praiseworthy goal. Classical Islam describes an inner struggle (jihad al-nafs, the struggle against one's own ego and faults) alongside an outer one, and the bare word does not mean "holy war" at all.576 Strikingly, the Quran uses the language of jihad for a struggle waged with the Quran itself — that is, by argument and patience, not the sword:
"So do not obey the disbelievers, and strive against them with it [the Quran] a great striving."
— Quran 25:52 (Saheeh International)1
"And those who strive for Us — We will surely guide them to Our ways. And indeed, Allah is with the doers of good."
— Quran 29:69 (Saheeh International)2
A note on the famous saying. A widely quoted report has the Prophet ﷺ returning from battle and calling the inner struggle the "greater jihad" and fighting the "lesser jihad." Hadith scholars actually grade that particular narration as weak, and it is not found in the most authentic collections.5 We mention it only to note that its idea — that mastering oneself is the harder, deeper struggle — does not depend on it: the Quran makes that point directly in the verses above.
When it does mean fighting, it is defensive and bounded
Islam does permit armed struggle, but as defense against aggression — and it is fenced in by rules. The first verses permitting fighting tie it explicitly to having been wronged:
"Permission [to fight] has been given to those who are being fought, because they were wronged. And indeed, Allah is competent to give them victory."
— Quran 22:39 (Saheeh International)3
"Fight in the way of Allah those who fight you but do not transgress. Indeed, Allah does not like transgressors."
— Quran 2:190 (Saheeh International)4
From these limits Islamic law built a body of rules of war — no transgression, no targeting of non-combatants — making armed jihad one regulated form of striving, not its essence.578 For why that rules out terrorism, see Does Islam promote terrorism?; for the everyday struggle to live well, see Ethics and Character.
In short
Jihad is the struggle to do what is right — beginning inside oneself. It can include defending a community under attack, but only within strict limits. Translating it flatly as "holy war" misses what the word has meant to Muslims for fourteen centuries.