Edward II invaded Scotland in 1314 with the intention of relieving Stirling Castle. According to an agreement made in 1313 it would be surrendered to the Scots by midsummer 1314 unless it was relieved by a new English army. Edward brought 15,000 infantry and 2,500 cavalry north with him and they met Robert I and his army of 8,000 infantry near Stirling.
Robert had avoided pitched battles up until this point but at Bannockburn he decided to stand and fight the English. His brother had made the agreement about which gave the English time to bring an army north and by all accounts Robert was furious about it but due to the code of chivalry he could not go back on the deal. He chose ground suited to infantry, made a plan and laid in wait for the English approach. The resulting battle was one of the biggest military humiliations ever suffered by the English as they were utterly defeated.
The key to Bruce's success was the use of the schiltron formation, large circles of men with 15 foot pikes who formed an impenetrable wall which the English cavalry could not break through. The Scottish infantry had been well trained and were able to advance in formation forcing the disorganised English back into the gorge of the Bannock Burn. Bruce also had his men dig various pits and traps which prevented the English from flanking his force.
The battle also provided Bruce with a personal opportunity to show off his martial prowess. An English knight, Sir Henry de Bohun, mounted on a heavy war horse, spotted an opportunity to attack the Scottish king and charged him. Bruce was on a riding horse and armed only with a battle axe, as the knight charged he stood his ground and at the last minute side stepped the charge and brought his axe down with great force splitting de Bohun's helmet and skull in two. When rebuked afterwards by his men for taking so great a personal risk Bruce shrugged it off only replying to complain about the loss of his good axe.
After the battle was won Bruce's loyal knight Sir James Douglas who had been knighted on the morning of the 24th was sent in pursuit of the English king. He pursued him mercilessly for fifty miles but Edward was eventually able to escape.
This victory did not however result in Edward II recognising an independent Scotland, it would be another 14 years until that happened, what it did do was to convince the Scottish people that Robert I was the rightful king and that he had God on his side. After the Battle of Bannockburn Bruce was fully accepted as the king and his few remaining opponents in Scotland were dispossessed of their lands and treated as "enemies of the king and kingdom".