Mac spoke about the process of creating the song in a September 2016 interview with Audience Network:

[Ariana and I] hadn’t spoken in a while, ‘cause we’ve been friends forever … I hit her up like, “Yo, I have this song for you.” I was lying, I didn’t have a song yet, but … I knew I wanted her to be apart of this album. … I write this crazy story in my head all the time like, “What’s the next song that we get on together?” There’s even a playlist in my laptop that’s all these beat titles like, “She would sound good on this one,” or “I like this, but it’s not it.” I’m going through, and then the simplest canvas was the one to paint on, you know?

I wrote the hook. I stayed up the whole entire night deciding if I wanted to sing or rap. … I don’t even fucking remember what the line is at this point, but I wrote some clever line that I was married to. Finally, I’m like, “I’ll go to sleep. Fuck it.” First thing I do when I wake up is sing that verse, and I sent it to [Ariana] and we set up a studio session. … Watching her write that and sing that was really awesome for me, because I remember us making songs when we were young, and seeing her just command it and be like, “I'ma do this, this, this, this,” and I’m like, “Hell yeah.” You even hear me in the background of the record—she hits this note and you hear the talkback mic of me being like, “Yeah!” I was really into it.