Uhud was a retaliation from Mecca following the Battle of
Badr.
The Meccans perceived Badr as an unprovoked attack on their
warriors for no other reason than that the Muslims wanted to steal
their goods. 66 Meccans were slain and 68 more were taken prisoner,
while only 14 Muslims died. The Meccans wanted to punish the
Muslims and teach them not to start wars for no reason.
So one year after Badr, the Meccans went to Medina for a
counter-attack. The Jews of Medina, who also wanted to get rid of
Mohammed, had shown them the weak points of the city. Abu Sufyan,
the high chief of Mecca, clearly stated that they had no hostility
towards Medina in general, only towards the Muslims in particular;
and when he said this, about a third of the Medinan army went home
and did not fight.
The Meccans then joined battle against those who remained loyal
to Mohammed. In fact, Mohammed was winning at first; the battle
only went against him when the Muslims stopped to collect booty
before the Meccans had given up fighting them. 75 Muslims and 22
Meccans were killed at this battle.
__________________________________________________
As one comment on the answer above, neither Muslims nor the
prophet are robbers. it happened coincidentally that a group of
pagan merchants from Mecca (Or Makkah) was passing by AlMadinah (or
Medina) and Muslims thought that it could be a good chance to get
the property of those people as compensation for all their
properties, lands, money, houses that they left behind in Mecca
when they migrated to Medina. However, verses from Quran was
revealed to the prophet to prepare for their fighting to suppress
their tyranny and aggression. The merchants got support of warriors
from Mecca and the Badr battle started between the two fronts of
warriors. The pagans were in much more numbers and war provisions
than Muslims during this battle.