I do not know for sure whether Lewis Carrol had all the above in mind while he wrote the line. This also must have come to him as a flash of insight. Nevertheless, the line has helped to get insights about certain facts of life
Read this post on durgadash.com