He wrote it in 1862 while on a boating trip on the River Thames with the Liddell family, who included the young Alice Liddell, who inspired the story.