The xx approached the writing for Coexist in a different way than their self-titled debut release. Singer-guitarist Romy Madley Croft and singer-bassist Oliver Sim developed the lyrics and melody live together, rather than exchanging emails, before involving DJ-producer Jamie Smith earlier in the songwriting process. This new method produced dividends with this song, which was penned towards the end of the recording for the album. "Oliver and I just wrote together in a room," Croft recalled to Spin magazine: "I playing keyboard in the basement and we just wrote, it just kind of happened. And we discussed the song, and it grew in interesting ways that never have existed if we'd written solely through e-mail. When we came to Jamie and played it to him live, he started playing along and brought a rhythmic twist that I would have never have thought of. It really happened very organically."
The cymbals at the start of this song are sampled from The Crusaders' "Lilies of the Nile," a track from their 1974 album, Southern Comfort. "The actual vinyl that I sampled it off was my parents record," explained Smith to Mojo magazine. "I've been listening to it as long as I remember. We could have replayed it and not had it to pay The Crusaders, but I wanted it because it has a history and meaning."