The Meccan army was in control of the stream of Badr...
The Meccan army was in control of the stream of Badr, and the ground of their campsite was of firm clay. Contrarily, the Muslims were far from the stream and thus experienced difficulty in finding water. To make the matters worse, many Muslims had nocturnal discharge while asleep and became "unclean" (najis). And the ground under them was sandy which was likely to prevent fast running during the battle.
God helped them by sending rain which provided them with water enough for their needs and made the sandy ground firm for them, while the firm clay of the Meccans' side became muddy, making their stand and maneuvers difficult.
(Qur'an, 8:11) In this background, look at the insinuation of some Western "scholars" who have written that the Holy Prophet (s.a.w.a.) had taken control of the stream of Badr and by refusing water to Meccans, reduced them to defeat!
Anyhow, the facts of the actual battle are, in short, as follows: With an ill-equipped body of three hundred and thirteen persons, having among them only two horses and seventy camels, the Prophet proceeded to Badr, about eighty miles from Medina, to meet the Meccan army. The forces met on the 17th of the month of Ramadhan, 2 A.H. (624 A.D.).
After individual combats according to the custom of the Arabs, between Hamza, 'Ali and Ubaidah (all Hashimites) on the side of the Muslims and Utbah, Shaibah and Walid ibn 'Utbah (all Umayyads) from the Meccan ranks, a pitched battle ensued. The stakes were high. Both forces fought valiantly but the Muslims were animated by holy zeal. In the thick of the battle, the Prophet prayed to God, earnestly beseeching Him thus: "O Lord, forget not Thy promise of assistance! O Lord!
If this little band were to perish, there will be none to offer worship unto Thee." Allah describes it in the following verses: (Recall) when you sought aid from your Lord, so He answered you: I will assist you with a thousand angels following one another. And Allah only gave it as a good news and so that your hearts might thereby be at ease, and victory is only from Allah; surely Allah is Mighty, Wise. (Qur'an, 8:9-10) The Muslims got the upper hand.