“Intolerable anguish and fury”  had compelled Keynes to leave Paris and resign his position as financial representative of the Treasury at the Paris Peace Conference. Jan Christian Smuts had already suggested to Keynes that he should “set about writing a clear connected account of what the financial and economic clauses of the Treaty actually are and mean and what their probable results will be. It should not be too long, as we may want to appeal to the plain man more than to the well informed or the specialist.”  Keynes replied that “ he could do at any time, and speedily, what Smuts proposed, for he had it clear in his mind and it only needed putting on paper.” . This account of the origin of the book is identified by Austin Robinson in his obituary to Keynes which appeared in the Economic Journal, March 1947.
Duncan Grant with John Maynard Keynes in 1914 © Public Domain
On his return to Cambridge in July, Keynes did indeed start to write The Economic Consequences of the Peace”. He wrote to Duncan Grant from King’s on 17 July,
“Most of the day, I think about my book, and write it for about two hours, so that I get on fairly well and am now nearly half way through the third chapter of eight. … But writing is very difficult, and I feel more and more admiration for those who can bring it off successfully. I’ve finished to-day a sketch of the appearance and character of Clemenceau, and am starting to-morrow on Wilson. I think it’s worthwhile to try, but it’s really beyond my powers.”
Keynes left Cambridge for London on 24 July, and at the beginning of August resumed writing the book from Charleston. He wrote every morning from breakfast until lunch and by mid-August was making fast progress.
In a letter to his mother on 3 September, he wrote that he had ‘managed to keep up my average of 1,000 words fit for the printer every day, seven days a week; but there are still some very difficult bits to do. I hope to finish by the first week of October and have it actually published before the last day of the month.’ 
During the Michaelmas term of 1919, Keynes delivered a course of lectures in Cambridge entitled “Economic Aspects of the Peace Treaty”. Austin Robinson writes in his obituary to Keynes: “My principal memory of them is of the dense throng and the fight to find even standing room, for everyone was prepared to cut anything to hear Keynes; I was then a classic, and was duly reprimanded by my tutor for surprising lacunae in my knowledge of Cicero’s Letters. But almost equally vivid is my memory of the burning sense of the world’s stupidities which animated the lecturer. Those lectures appeared in a variant form at the end of December 1919 as The Economic Consequences of the Peace, and the world shared our excitement.”
 Millin, Sarah Gertrude. General Smuts. London: Faber and Faber, 1936
 Skidelsky, Robert. John Maynard Keynes. Volume 1. London: Macmillan, 1983