Battle of Badr
The battle of Badr was the first great battle in the military career of the prophet Muhammad according to the sira. Again according to the sira in took place in the month of Ramadan in the second year of the hijra (circa 624 AD). It was a watershed moment in the prophetic career, where some of the prophet's greatest enemies from Mecca were killed or humiliated. It was also interpreted as a sign of divine favor by the Muslim community in Mecca, with angels including Jibra'il reportedly taking part. The runup to the battle, the battle itself and the aftermath were also the backdrop of the revelation for many verses in the Qur'an including the majority of surat al-anfal, the sura of war booty or voluntary gifts. The aftermath of the battle would see Muhammad put in place new rules around the division of booty. The defeat of the Meccans would harden their resolve to resist Muhammad was well as creating several blood fueds that the Meccans felt needed avenging, ultimately culminating the defeat of Muhammad and the Muslims at the Battle of Uhud. For Muhammad, the battle would solidify his reputation as a commander and strengthen the faith of his community.
After having fled with his followers from Mecca to Medina in the hijra Muhammad had continued his preaching, growing his ranks amongst the so called Ansar or partisans/helpers who came on board the movement, joining the ranks of the muhajiruun or emigrants from Mecca. Once Muhammad had felt his position strong enough, he had embarked upon maghaazi or raids against the caravans of the Meccans, which were the life blood of the mercantile city. A raid on a Qurayshi caravan netted Muhammad and his followes a massive loot haul with no casualties. This whet the appetite of Muhammad and the Muslims for more loot. When they learned that the biggest caravan of the year was heading back to Mecca from Syria, Muhammad and his soldiers started planning their own raid. Abu Sufyan, chief amongst the Meccans, though, learned of Muhammad's plans, as Ling says "no doubt one of the hypocrites or one of the Jews"  and immediately set forth sound the alarm to his countrymen. The Meccans gathered outside of their place of worship and formed a force to stop Muhammad.
Order of Battle
According to the traditional sources, ansar formed the majority of Muhammad's forces with a minority of muhaajiruun. With Muhammad were some of his best men, including Ali. Abu Sufyan was not with the Meccans, but they had sent their best warriors. The Muslims numbered about 300 warriors, including some young boys and old men, with about 70 camels and a smaller number of horses. The Meccans counted almost 1000 men, almost all of them warriors in their prime, and twice as many pack animals as the Muslims.
Lead Up to the Confrontation
Muhammad had been stalking the caravan for several days when he discovered that the Meccans were coming to intercept them. He determined that the place of the battle would be Badr, and sent his forces ahead to secure the access to the water. The Meccans, discovering his camel turds, deduced that camels being fed by the dates of Medina where nearby. In the meantime, the Muslims, fearing for the lift of their prophet, built a booth for Muhammad and his animal and left an elite guard to protect his life. The Meccans advanced across a broad plain and were met by the Muslims. As was custom, the mubaarizuun or great warriors of both sides engaged each other in one-on-one combat. Three Muslims and three mushrikuun advanced to fight one another. All three polytheists fell in battle, while the Muslims suffered one wounded.
The duels being concluded, the general melee commenced. Two Muslims were felled by arrows before the two forces met one another. The Muslims, though outnumbered, were according to the sira far from out-gunned: the angel Jibra'il came to their aide with a host of angels. Two onlookers from a nearby mountain claimed they had seen the angels coming down from the sky to aide the Muslims, and one of them apparently died of a heart attack upon seeing it. One Muslim warrior had has arm chopped almost all the way off but continued to fight with his other hand, until the dangling, mangling appendage so vexed him that he stepped on the hand and broke it off of his body. Muhammad eventually entered the fray, and gave one warrior who had lost his sword a wooden club as a replacement, which miraculously transformed into a full scimitar. The battle raged for several hours, but in the end the Muslims and their angelic allies were victorious.
The victorious Muslims took much booty. The Muslim warrior who had stayed behind to guard Muhammad felt that it was unfair to allow the warriors who had adanvanced against the Meccans to keep all of the booty which had fallen into his hands, and according to the sira this prompted the revelation of surat al-anfal. Many prisoners were taken though many of them were also executed. Muhammad ordered that Abu Jahl be specifically found and executed. He was found almost dead and finished off. Several of the prisoners who had been harsh against Islam or were hated by the Muslims were executed. Muhammad stayed in Badr for three days after the battle and mocked the dead. When executing a prisoner who asked who would take care of his children, Muhammad's answer was simple: "hell." Some of the prisoners were ransomed back for alot of money to the Meccans. The Meccans were highly demoralized by the loss of so many of their great warriors. The faith of Muslims was restored thanks to the victory and the aide of the angels. His status was also raised in Medina thanks to the victory amongst the Jews and the unconverted Arabs.
The battle was the "revelational circumstance" for the revelation of most of surat al-anfal.
- Martin Lings Muhammad: His Life Based on the Earliest Sources Inner Traditions 2006, page 141