Tolkien maintained however, that it wasn't intended as an allegory. “ I don't like allegories.  I never liked Hans Christian Andersen because I knew he was always getting at me,” he said. 

The trilogy was written, he recalled, to illustrate a 1938 lecture of his at the University of Glasgow on fairy stories.  He admitted that fairy stories were something of an escape, but didn't see why there should not be an escape from the world of factories, machineguns and bombs. 

It was joy, he said, that was the mark of the true fairy story: “... However wild its events, however fantastic or terrible the adventures, it can give to child or man that hears it, when the ‘turn’ comes, a catch of the breath, a beat and lifting of the heart, near to (or indeed accompanied by) tears, as keen as that given by any form of literary art, and having a peculiar quality.” 

His own fantasy, it was said, had begun when he was correcting examination papers one day and happened to scratch at the top of one of the dullest “in a hole in the ground there lived a hobbit.”  Then hobbits began to take form. 

They were, he decided, “little people, smaller than the bearded dwarves.  Hobbits have no beards.  There is little or no magic about them, except the ordinary everyday sort which helps them to disappear quietly and quickly when large stupid folk like you and me come blundering along, making a noise like elephants which they can hear a mile off.  They are inclined to be fat in the stomach; they dress in bright colors (chiefly green and yellow); wear no shoes, because their feet grow natural leathery soles and thick warm brown hair like the stuff on their heads (which is curly); have long clever brown fingers, goodnatured faces and laugh deep fruity laughs (especially after dinner which they have twice a day when they can get it).” 

Discovering England

He settled these protected innocents in a land called the Shire, patterned after the English countryside he had discovered as a child of 4 arriving from his birthplace in South Africa, and he sent some of them off on perilous adventures.  Most of them, however, he conceived as friendly and industrious but slightly dull, which occasioned his scribble on that fortuitous exam paper. 

“If you really want to know what Middle‐earth is based on, it's my wonder and delight in, the earth as it is, particularly the natural earth,” Tolkien once said, His trilogy was filled with his knowledge of geology and botany.