Alfred the Great was King of Wessex, not all of England. But he was the first king to proclaim himself King of the Anglo-Saxons.
He was King at a time when the English kingdoms of Northumbria, East Anglia and much of Mercia was over run by invading Danes.
In 877, the Danes, under the leadership of Guthrum, launched a surprise assault in the middle of winter, and Alfred escaped to the marshes of Athelney, where he waited until the spring of 878 to muster an army and strike back at the Danes.
It was during his time at Athelney, when the story of him burning the cakes originated. There is also a story that he went under disguise, as a vagabond, and infiltrated a town which was under the control of the Danes.
Alfred's army met Guthrums army at the Battle of Eddington, which was probably fought on or near Bratton Camp, the site of an Iron Age hill fort. The Anglo-Saxons won the battle, and chased Guthrums army to Chippenham, where they besieged Guthrum and his army for fourteen days, until hunger forced them to seek terms of surrender.
This lead to The Treaty of Wedmore. Under this treaty, England was divided into the Danelaw and Wessex, the border was Watling Street, a Roman road which ran from London to Liverpool.
Alfred knew that Guthrum wouldn't break the treaty, but as other Danish chiefs had not signed it, then they would not be bound by it. Alfred also had no intention of keeping the peace. So he began building a chain of fortified towns (Burghs) along his border with the Danelaw. He also started building a fleet of war ships to take on the Danes at sea.
This was the laying of the foundations for the reconquest of the Danelaw, and the eventual unification of England as a single kingdom. This was Alfred the Great's vision, though he never lived to see it, as he died in 899, and was succeeded by his son, Edward the Elder.
It was his grandson, Athelstan who finally completed the unification of England in 927.
As well as fighting the vikings, Alfred was a firm believer that every free born boy should be taught how to read and write. He taught himself Latin, and commissioned the translation of scholarly literature, which was invariably written in Latin in those days, into English (Old English), some of the books he translated himself.
He also codified laws that enshrined the rights of all people in his kingdom.
It is fair to say that Alfred the Great, while famous for his military feats, was a man who spent more of his life covered in ink, rather than blood.