If you’ve ever wondered why Swae Lee, the 21-year-old rapper and one-half of Rae Sremmurd, received a co-writing credit on Beyoncé’s “Formation,” let Mike WiLL Made-It explain. In a new profile with The New Yorker, the super-producer reveals the recording process, which began way back in 2014, behind her latest hit.

It started with A-Pluss, a friend of Mike Will’s since high school and one of the staff producers at Mike’s production company Ear Drummer Records. A-Pluss had started the beat for “Formation” “back in Atlanta and Will had it with him on his phone when he was driving from L.A. to the Coachella music festival with [Swae] Lee and his brother, in 2014.”

Will said, “So we’re in the middle of the desert. And we’re just coming up — we just freestyle, you know? — and Swae Lee said, ‘OK, ladies, now let’s get in formation.’ And we put it on the VoiceNote. Swae Lee’s got so many voice notes that he doesn’t even record, but I’m like, ‘Dog, we got to do that ‘get in formation’ shit.’ That could be a hard song for the ladies. Some woman-empowerment shit. Like, ‘Ladies, let’s get in line, let’s not just fall for anything.’ I’m seeing that vision.”

So, when they got back from Coachella, they booked a studio, and Swae Lee “ended up just laying it down.” Will then “sent the song, along with five or six others, to Beyoncé and her team.” Jon Platt of Warner/Chappell, their mutual publisher, “made sure she listened.”

A few months later, Will ran into Jay and Bey after a Clippers-Cavaliers basketball game. According to him, “Bey was like, ‘Yo, I like that ‘formation’ idea.’ And I told her what I was thinking about the woman empowerment, and she was like, ‘Yeah I kinda like that idea.’ And she just left it like that.”

But back in New York, Beyoncé began writing verses for the song, making sure to keep its central concept.

“Next thing I know,” Will said, “Big Jon” — Jon Platt — “told me, ‘Yo, this shit’s crazy, you got to hear this.’”

Will then traveled to New York and spent a week with Bey recording the song.

She “took this one little idea we came up with on the way to Coachella, put it in a pot, stirred it up, and came with this smash. She takes ideas and puts them with her own ideas, and makes this masterpiece. She’s all about collaborating. That’s what makes her Beyoncé. Being able to know what she wants. A lot of people don’t know what they want. To the point where you can bring them some hot shit, and they’re like, ‘This shit ain’t it. I need a hit, bro.’ And I’m like, ‘Man, this is a hit. If you don’t like this line or that line, you should take this line out and put your own lines in there, and we doctor it up.’ Some people want it cooked. They just want to put a little icing on it and bite it. But it’s really a process to make one of these great songs. It’s layers. Layers and layers and layers.”