Someone was asking how to stop the Muslims. Maybe we can learn a little from history.
Battle of Tours, AD 732
Charles Martel, outnumbered but with battle-hardened warriors, determined to hold back the Muslims from advancing further into France. They already had the Iberian peninsula (Spain and Portugal). Aquitaine (southern France) had already fallen as well: Tours and then Paris would have been next.
Martel chose the location of battle, surprising the 'Umayyad' army. He used the strategic high ground, wooded concealment, knowledge of the enemy's number, and a phalanx formation. Although the Franks had not the cavalry of the Moors, they were steely and disciplined. They would not break ranks even when presented with charging cavalry.
After 5 days, the Umayyad had no viable path to victory, or yet any knowledge of how many forces they were fighting. They had a lot of booty from looted towns that they did not want to lose, and they needed to retreat over the Pyrenees to get back on safer soil.
In short: Better tactics, better intel, better discipline, and more resolve. It also helps if your enemy is far from home.