John Lennon wrote the 1967 song in response to a letter from a schoolchild at his former grammar school describing how his English teacher made the class analyse Beatles lyrics. Lennon deliberately made the lyrics as nonsensical as possible. The walrus is a reference to Lewis Carroll's poem The Walrus and the Carpenter, from his book Through the Looking Glass.
Listen on Spotify: Bono's version
I am he as you are he as you are me and we are all together. See how they run like pigs from a gun, see how they fly. I'm crying...
The full lyrics
"The time has come," the Walrus said, "To talk of many things: Of shoes—and ships—and sealing-wax— Of cabbages—and kings
The full poem