The song was inspired by the actor Peter Fonda, who was on an acid trip along with George Harrison and John Lennon while they were together at a party. Accounts vary as to how events unfolded, but there is a consensus that Fonda kept saying "I know what it's like to be dead," which ended up being a key line in the lyric.
At this time, Harrison, Lennon and Starr were just starting to experiment with LSD. While The Beatles were on tour in Los Angeles, they rented a house and threw the party. By Fonda's account, Harrison was having a bad trip, so he tried to settle the guitarist by telling him that he had nothing do be afraid of, and that he know what it's like to be dead because he shot himself in the stomach when he was 10 years old and nearly died.
In his 1980 Playboy interview, Lennon said that he was trying to take in the beauty of the girls and the atmosphere, and Fonda kept coming over and whispering, "I know what it's like to be dead, man." Lennon found this creepy and annoying, but the incident stuck with him and inspired one of the most psychedelic Beatles songs.
John Lennon originally wrote the song as "He Said He Said" because the line came from Peter Fonda, but it didn't sound right, so he changed it to "She."
This song marks an interesting spot on the Beatles timeline, as it was the first time and LSD experience directly influenced a song. They could be wildly creative on acid, but it caused a rift in the band as McCartney initially abstained. It also led many fans to listen with an ear for drug references, leading to some misguided interpretations of their songs.
Paul McCartney didn't play on this track, as during the recording he found himself at odds with his bandmates. George Harrison played the bass part.
The Beatles recorded this in nine hours during the last session for Revolver.