Honestly whole books and theses have been written on this.
I've written a little about it here.
For reading I would recommend Hill et al, The Defence of Wessex; Baker and Brookes, Beyond the Burghal Hidage; Reynolds et al, Landscapes of Defence; Stenton, Anglo-Saxon England; Lavelle, Alfred's Wars and The Danes in Wessex to start with. Our primary sources are The Anglo-Saxon Chronicle and Asser's Vita Ælfredi.
To put things very briefly: Viking warfare is based on rapid manouevre and avoiding fair fights as much as possible. As Asser recounts for the year 871, Wessex spends so much manpower chasing down small forced and defending against raids that when it comes to pitched battle, its forces are often outnumbered and exhausted.
Alfred's strategy comes from a mass overhaul, reform and bureaucratisation of the Anglo-Saxon defensive infrastructure. Potentially influenced by the fortified bridges over the River Seine to defend Paris from the Vikings that he would have witnessed on his childhood visits, as well as earlier English fortification networks from Offa's Mercia, the new burghal system essentially establishes a system of fortified garrison sites at roughly a day's march from each other at major road junctions, river crossings, bridges, landings etc. These severely limit the Vikings ability to outmanoeuvre the English, and instead allow an organised military reaction force to rapidly respond to Viking threats.