In everey prophet,s life there are two phases, one is of peaceful preaching, & other is of non-peace full stuff. Noah preached for 500 years , those who didn’t submit to God were killed by God . Moses preached to the Pharoah, he refused & died. In Islam Jihad (struggle!!) is against Zulm & Udwaan (Opression/Injustice & Animosity)(See:8:39, 2:217). In the above examples, people were killed for the same reason. Sometimes rather then sending a flood, God asks his followers to attack (called Qital not jihad) the unjust & oppressors. It’s a double test, for both parties. This is what happened under Joshua & David. (Or what failed to happen under Moses). The only exception is Jesus, but he will be coming back to to fulfil his mission. This time he won’t practice “turn other cheek” philosophy.
Coming back to the topic , Gandhi as I have heard, developed Satyagarha after studying Meccan life of Prophet Muhammad . It was the time when he was forbidden to fight. (4:76). Scholars give a lot of reasons for this. People who have described Jihad say it starts with fighting ego. Not fighting back, not cursing back, not killing back was a part of this . Preaching peace fully & not stumbling upon some kind of “mine is better than yours” arguments were also highly recommended (6:68). Jihad & Purification with Quran were prescribed . (25:52).
Other than being a cleansing of ego for believers, this is also a clear sign for non-believers . Its clearly visible to them that these people are oppressed not because they want money or power, but because they obey one God. Muslims were taunted a lot by the Mekkan elites for teachings like “slaves are equal”, “women should be given rights” & “come back to Abraham’s God”. But for people who were not ruled by their ego, Muhammad’s teachings made perfect sense.
Later on after a lot of torture, killings, a two year old social boycott (during which Muslims had to boil sticks & eat them) & failed assassination attempts on Muhammad, they migrated to Medina. The state was formed. Meccans confiscated all Muslim property. Meccan muslims didn’t have much knowledge of agriculture. Trade routes were blocked. This lead to caravan raiding. Meccans attacked (Badr), & failed. Meccans reattacked (Uhad) & partially succeeded (Quran says this happened because they followed their wishes rather than the prophet). Meccans gathered all Arabia & went to Medina to annihilate everything. Muslims came to realize there is no point of fighting this huge army & dig a trench around medina, except for the portion under Banu Quraiza. In the middle of this horrible situation, BQ broke their treaty & changed their alliance (we know the rest). Later on after a failed attempt to perform haj lead to Hudabiah treaty. Breaking of which lead to Conquest of Mecca . Again there was no fight . Heraclius , after taking Syria from Persians was planning to attack Medina , which lead to Tubuk.
So if you see Meccan period, it was all peaceful struggle. In Medinan period, muslims were faced with fight or die situations, so obviously they had no option other than fighting. If Muhammad didn’t fight at that time, Muslims’ fate would have been same as the fate of Christians . There are a lot of people who bring up this Jesus vs. Muhammad debates . Fact of the matter is, that Jesus didnt preach Christianity. He asked people to “keep the commandments” & “be vigilant as a snake”. Finally he asked his followers to take up swords (Luke:22:35-38). I don’t know how Christian scholars interpret this . In the end , he left his followers without power, stability & security. They suffered a lot . Israeli Spirituality was taught to gentiles who didn’t have the slightest comprehension of these things (unlike jews who had experienced 2000 years of spiritual evolution). Some people had to live, some people had to rule. Obviously teachings had to be changed, commandments had to be abrogated. We all know who was born of a virgin on 25th December. This is what happens when a prophet leaves his people without power. This is what wasent supposed to happen after Muhammad.
Later on Christianity spread into Europe by power & preaching. Three continents were ethnically cleansed. Two were enslaved. We don’t see this with Islam. India is still Hindu after 1000 years of Muslim rule. Andalusia was Christian after 700 years of Muslim rule. Native Americans were still breathing despite frequent contact with Arab traders.