Gideon is a reluctant military leader, chosen by God to lead an army against the Midianites who are oppressing the Israelites. The Midianite army is composed of over 135,000 men; Gideon manages to gather about 32,000 men of Israel for his force... not great odds. But, to his shock, God informs him that this is too many and that he's to allow any man who is afraid to go back home... 22,000 of the men leave. Only 1o,ooo remain to fight the Midianites, but God tells Gideon that this is still too many . He instructs Gideon to watch his men drinking from the river: he is to send home any who kneel/lay down and drink directly from the water, and keep any men who scoop the water in their hands to drink. A reason is not given for this, though presumably the ones using their hands would be more alert/ready. Whatever the reason, at the end of the day Gideon is left with only 300 men to face off against 135,000 Midianites. God says that this is so that no one will make the mistake of thinking that the victory is won through strength of numbers instead of through His will. Gideon and his men will have to trust God, because they can't trust in their own power and ability.
The Midianites are violently awakened to find themselves seemingly surrounded by what appears to be a large horde. They panic, the soldiers stampeding and lashing out about them, thinking they're fighting the enemy but in reality managing to kill a good number of their own men. When the panic and confusion is at its height, Gideon orders his 300 to attack; the Midianite army breaks and flees with the Israelites in hot pursuit.