McCartney wrote the song after seeing two monkeys copulating in the street while on retreat in Rishikesh, India, with the Maharishi Mahesh Yogi. He marvelled in the simplicity of this natural scenario when compared to the emotional turmoil of human relationships. He later said:
A male [monkey] just hopped on the back of this female and gave her one, as they say in the vernacular. Within two or three seconds he hopped off again and looked around as if to say, ‘It wasn't me,’ and she looked around as if there'd been some mild disturbance ... And I thought ... that's how simple the act of procreation is ... We have horrendous problems with it, and yet animals don't.