Ed Sheeran wrote the song with frequent collaborator Benny Blanco ("Don't
," "Castle on the Hill
") and Julia Michaels ("Justin Bieber's "Sorry
," Selena Gomez's "Good For You
Michaels told Billboard
the track's genesis was a panic attack she had at an Ed Sheeran writing camp. She was the only person who hadn't written with the English star before as well as being the youngest person at the camp, and felt totally out of place. The American tunesmith was writing with Foy Vance when Sheeran came over with some cameras for his Songwriter
documentary and asked them if they'd got anything. Michaels just backed away and ran into Benny Blanco's room. Blanco calmed Michaels down and told her they would write something together, "No cameras, just you and me, you got this."
The pair listened to some tracks and Michaels started the course melody of "Dive," before asking to leave as she "was so tired and so overwhelmed."
By the time Michaels had returned the next day, Sheeran had heard her work in progress on "Dive" and told the pop songstress he loved what she'd done so far and asked if he could help her finish it. They shut all the cameras out and completed the song. Now feeling comfortable in Sheeran's company Michaels helped the Brit write Anne-Marie's "2002
" immediately afterwards.