Although it is the last song (track 14) to be heard on Revolver, Tomorrow Never Knows was actually the first song that The Beatles recorded for the album.
After the recording of Rubber Soul, and the tour that followed, The Beatles had perhaps the longest break of their careers to that point, which amounted to about 3 months. John took this opportunity to experiment with acid. Like most people who began to take LSD around this time, he did so with the help of Timothy Leary. Leary's book The Psychedelic Experience served as John's guidebook for successfully tripping. Leary liked the passages from The Tibetan Book of the Dead, and so they became a part of this book.
While experimenting with acid, using Leary's book as a guide, John had a tremendously satisfying trip while reciting the passages from the Tibetan Book of the Dead, and as with most things, he wanted to capture it in his music. Thus, John lifted some of the lines directly from the book and put them into the song.
To say that this song was revolutionary when it was released in August of 1966 is a bit of an understatement. Nothing that had been released in popular music to that point even sounded close to this, with its backwards masking and many tape loops and Indian instruments.
The song was recorded in April of 1966, with The Beatles playing their normal instruments. George also played the sitar and tambura on this track. John played organ, and John, George, and Paul each helped with creating various tape loops (including one of Paul laughing).
If you haven't heard this song, then you should, because it's pretty incredible. In fact, if you haven't heard Revolver, then you really ought to hear the whole album. If you're interested in learning more about this song, I wholeheartedly recommend the book Revolution in the Head, by Ian MacDonald, which I referenced for this node. In fact, I recommend the book for anyone interested in The Beatles at all.
Google "Tomorrow Never Knows lyrics" if you're interested in seeing the lyrics.