We may mention here as to why the warriors of Islam were victorious. It was due to the fact that till the last moment of their victory they had no motive except that of jihad in the path of Allah, acquisition of His pleasure, conveying the message of Allah and the removal of every impediment in its path.
Why were they defeated thereafter? It was because, after achieving victory, the aim and intention of most of the Muslims underwent a change. Attention towards the booty, which the army of Quraysh had themselves thrown in the battlefield and had fled, affected the sincerity of a large group and they ignored the orders given by the Prophet.
Here are the details of the event: While explaining the geographical conditions of Uhud we had mentioned that there was a particular gap in the middle of Mt. Uhud and the Prophet had entrusted fifty archers under the command of Abdullah Jibir to guard the valley behind the battle front and had given these orders to the commander of the group: "Prevent the enemy from passing through the gap in the mountain by shooting arrows and don't vacate this point at any cost whether we are defeated or victorious".
The fire of warfare blazed up on both the sides. Every time the enemies wished to cross this valley they were repulsed by the archers.
When the army of Quraysh threw away their weapons and property on the ground and ignored everything else to save their lives, a few brave officers of Islam whose oath of allegiance was perfectly sincere pursued the enemy outside the battle-field. But the majority ignored the pursuit and placing their weapons on the ground began collecting the booty and imagined that the battle had come to an end.
The persons guarding the valley behind the battle front also decided to avail of the opportunity and said to themselves: "It is useless for us to stay here and it is profitable that we too should collect the booty". Their commander, however, reminded that the Prophet had ordered that whether the Muslim army gained victory or was defeated they should not move from their post. Majority of the archers, who were guarding the passage, opposed their commander and said: "0ur staying here is useless and the Prophet meant only that we should guard this passage when the battle was in progress, but now the fighting has ended".
On the basis of this false presumption forty men came down from the vigilance post and only ten persons remained there. Khalid bin Walid, who was a brave and experienced warrior and knew from the very start that the mouth of the passage was the key to victory and had attempted many times to reach at the back of the war-front through it, but had to face the archers, took advantage of the small number of the guards this time. He led his soldiers towards the backside of the Muslim army and making a surprise attack reached at the party of the Muslims. The resistance by the small group which was stationed above the mount could not prove effective till all the ten persons after putting up a tough fight were killed at the hands of the troops of Khalid bin Walid and Ikrimah bin Abi Jahl. Soon after that the unarmed and neglectful Muslims were subjected to a severe attack of the enemy from behind.
After having gained possession of the sensitive point Khalid sought the collaboration of the defeated army of Quraysh, which was in a state of flight, and strengthened the spirit of resistance and perseverance of Quraysh with repeated shoutings and cries. On account of disruption and confusion, which prevailed in the ranks of the Muslims, the army of Quraysh soon surrounded the Muslim warriors and fighting commenced between them once again.
This defeat was due to the negligence of those persons who vacated the passage for their material gains and unintentionally cleared the way for the enemy in such a manner that the mounted soldiers under orders of Khalid bin Walid entered the field from behind.
The attack by Khalid was supported by an attack by Ikrimah bin Abi Jahl and unprecedented and surprising disorder prevailed in the forces of Islam. The Muslims had no alternative but to defend themselves as a scattered group. However, as liaison with the command had also been disrupted they did not succeed in defending themselves and suffered heavy casualties, so much so that some Muslim soldiers were inadvertently killed by other Muslims.
The attacks by Khalid and Ikrimah strengthened the morale of the army of Quraysh. Their retreating forces re-entered the field and lent them support. They encircled the Muslims from all sides and killed a number of them.