After the Battle of Badr the Meccans wanted revenge. They raised an army and marched to Medina. There they camped outside of the town waiting for the Muslims. Mohammed wanted to wait until the Meccans attacked the town.
He figured he could use it for a defence. Many of his hot-headed warriors now felt invincible however. They wanted to march out to meet them. Mohammed finally agreed and marched out with his men to meet the Meccans at a place called Uhud.
The battle began well for the Muslims, who now fought with suicidal bravery. They believed that death would lead them to Paradise. In the heat of the battle, the Meccans were cut off from their camp which held their supplies and valuables.
Mohammed had set a group of archers to protect his rear. Seeing that the Meccans were cut off from their camp, these archers ran forward. They wanted to be first to grab the booty. This left Mohammed's army exposed and the Meccan cavalry charged smashing apart the Muslim’s defences.
Mohammed had to run for his life and his army was soundly defeated. Fortunately for him, the Meccans did not press their advantage. They had come for tribal justice and this had been extracted. Like most human societies which resort to violence, the Meccans had an objective.
Once this objective had been achieved, they put down their weapons and went back to their lives.
For many Muslims, the defeat at Uhud was a stark reality check. They had believed that Allah was behind them and they were therefore invincible. Mohammed, cunning as ever, used the setback to his advantage.
He explained to the Muslims that Allah was testing them. If he gave them nothing but easy victories, Allah would never see who his true followers were. It was also important for the Muslims to learn that they were fighting primarily for the glory of Allah and the advancement of Islam. The spoils of war were really just fringe benefits. Concentrating on the pleasures of this life had caused them to be defeated. Allah was displeased with them.
From the Koran:
3:140 If you have been wounded, be certain that the same has already befallen your enemies. We bring misfortune to mankind in turns so that Allah can discern who are the true believers and so that we may select Martyrs from among you. Allah does not love those who do evil.
3:142 Did you think that you would be permitted into Paradise before Allah tested you to see who would fight for his cause [Jihad] and endure until the end?
In war, one of the most important factors for victory is to maintain good morale amongst your troops. When you are having constant successes this is easy, but a string of defeats can cause soldiers to give up hope and lose the will to fight.
Mohammed, with his usual brilliance, gave his fighters divine inspiration to fight through victory or defeat. Don’t fight just for victory he told them, Allah has assured us of that; fight so that Allah can judge your devotion to him and he will reward you with Paradise. This is the next rule of Jihad, which ensures that Muslim fighters always have high morale, even when they are in a hopeless situation.
Rules of Jihad:
7) Never ever give up, even when you are being beaten.
After the battle of Uhud, Mohammed once again sent out assassins to kill the leader of a group who opposed him. With Mohammed's blessing they deceived the man into believing that they were friends, using his trust to get close enough to kill him. Mohammed used this type of deceitful operation many times to kill political opponents.
From The Sira:
I681 One of the Ghatafans approached Mohammed saying he was a Muslim but no one else knew it. Mohammed told him, “Go and sow distrust among our enemies. War is deceit.”
And from Bukhari’s Hadith:
B4,52,268 Mohammed said, “War is deceit.”
Mohammed was a master of psychology and regularly used deceit to gain advantage over his enemies. He also encouraged his followers to do the same.