West and Fivio first worked together for the song "Off the Grid" (with Playboi Carti, who provides ad-libs on this song), released on West's album Donda in 2021.[4] The collaboration came together after West called Fivio Foreign to record in Mercedes Benz Stadium the night before the listening event for Donda.[5] According to Fivio Foreign, West praised the verse the rapper recorded for "Off the Grid", lauding his similarity to his frequent collaborator, Jay-Z. West was also adamant about getting Jay-Z himself to perform on "City of Gods", but this never materialized.[6][7]
Before Donda released, Fivio Foreign told his fans on Twitter that West was executive producing and performing on his upcoming album B.I.B.L.E.[8] On February 5, 2022, Fivio Foreign tweeted "I ain't gon lie, Ye gave me the feature of the Yr.. He was talking 2 crazy on that verse" [sic]".[9]
When Fivio Foreign first got the beat for "City of Gods", it featured a sample of the 2015 track "New York City" by The Chainsmokers. When playing it for West, he said "Yo, I see something with this song" and asked Fivio to send the beat so he could change it around.[10] One of the changes West made was taking out the sample and getting Keys to sing the vocals instead.[10] Originally Fivio was rapping "Ain't no king of New York, nobody really in charge", and when he played it for West, he said "You gotta say you're the king of New York". Fivio Foreign then suggested that he should rap " Pop was the king of New York, now I'm the one that's in charge" (thereby paying tribute to late drill rapper Pop Smoke) which West responded to by saying "Yo that's even better!".[10]
The song is dedicated to late rapper, friend of Fivio Foreign and longtime collaborator TDott Woo, who was shot and killed a week before the release of the song. In a statement put up with the release of the song, Fivio said "T Dot. That's my baby boy. I never thought I'd be doing this without you here with me. You supposed to be here with me but you gon' always be the prince in the City of Gods. Your name will forever live through with me. Long Live Prince T Dot."[11]
Complex's writers have associated the song with both Empire State of Mind and Run This Town, appreciating the combination of Foreign's drill music with Kanye's production, even though "the glitzy synth made it feel like American Eagle drill; [...] Just too glossy" and that "overall, it’s a bit of an oblong song". At the end Alicia Keys was prized for her "singing reverently about New York City; [...] with impressive vocals on the chorus".[15] Christine Ochefu by GQ was pleasantly impressed to find Keys on a drill track.[16]
On April 7, 2022, Alicia Keys released a solo version of the song with a stripped back production called "City of Gods (Part II)".[18] The video of the song was nominated at the 2022 MTV Video Music Awards in the Best R&B category.