A graduate of Merton College, Oxford, where he obtained a First in modern history in 1934, Williams was commissioned as a second lieutenant in the 1st King's Dragoon Guards in June 1939. In February 1941, the troop he was commanding was the first British unit to encounter the German Afrika Korps. He was recruited to work in military intelligence by BrigadierFrancis de Guingand, who later became Montgomery's chief of staff. As an historian, Williams was accustomed to integrating different sources of information to build up a larger picture. He integrated information from Ultra with that from other sources such as the Y service, prisoner of war interrogations, aerial reconnaissance and ground reconnaissance behind enemy lines by the Long Range Desert Group.