Relations with Muhammad's group deteriorated, and so Muhammad took his followers to Medina, an event called the Hijra ("a severing of ties of kinship or association"), Latinized to Hegira. In the Julian calendar, this event took place on 16 July 622.
While in Medina, Muhammad began raids on Quraysh trade caravans in order to enrich his people. News of a particularly large caravan from Gaza to Mecca—supposedly 1000 camels carrying 50,000 dinars' worth of goods—prompted him to send his men to attack it at the town of Badr. The leader of the caravan, Abu Sufyan, heard rumors of the intended attack, so he sent messengers to Mecca for help. Mecca sent 1000 Quraysh. Their leader sent scouts ahead to reconnoiter. He diverted the caravan to a more difficult route that would take them out of danger.
Word was sent back to the approaching Quraysh force, at which several hundred decided to go home. One group that left was related to Muhammad's mother. Muhammad learned of the nearby presence of the Quraysh and ordered his people to fill all the available water wells with sand except one that the Muslims controlled. A clash between the Quraysh and Muslims followed. The Quraysh assumed that the Muslims would simply be scared off by a show of force, but the Muslims were well-watered and filled with visions of heavenly reward for fighting, while the Meccans were dealing with thirst and aware that they could be fighting against their own kin and former friends. Also, the Meccans' intent was to capture the enemy for punishment; the Muslims were ready to kill.
The Battle of Badr started with individual combat between three warriors of each side, but quickly devolved into a melee. It did not last much past noon. The Muslims gained loot as well as camels, weapons, armor, and captives for ransom. The illustration is of the aftermath of the Battle of Badr and the casting of the defeated Quraysh bodies into a dry well, from a 14th century retelling.
This was motivation for the Quraysh to send an attack against the Muslims. How that went will be tomorrow's topic.