This was written by Ed Sheeran, who previously penned One Direction's Take Me Home tracks "Little Things" and "Over Again," as well as "Moments" from the deluxe version of their debut album.
Ed explained to Nova's Kent 'Smallzy' Small that he initially declined Simon Cowell's request for him to pen a song for 4. "I wasn't gonna do it... basically, my record label got very annoyed that my first #1 was a song that I gave to someone else," he said, "and they were kind of like "don't do it."'
However, while in Copenhagen, inspiration struck and Ed, "went into the rest room, where it's big and reverberative" and penned the tune. He said that his record label didn't mind as, "it's one of these songs that I wouldn't have used for myself, it's written specifically for them."
Simon Cowell explained to Capital Radio how the collaboration came about. "The funny story was that Ed came down to see me at Got Talent, as he was performing. He came up to the dressing room and I went, 'Where's the One Direction song?' And he said, 'I didn't know you wanted a song from me', and I went, 'Yeah'."
"And then literally a week later he comes round to my house with his manager one night, turned up around 11 o'clock and said, 'Do you like this song?' and he played me '18' and it took me about a millionth of a second to say yes."