Azalea's sophomore studio album, Digital Distortion, was initially set to be released on 24 June 2016, with its lead-single "Team", being released in March 2016. However, the album was postponed several times in 2016, with Azalea initially addressing the delay due to her stint as a judge on the eighth season of The X Factor Australia, and later adding that she also delayed the album to include a collaboration with Russian-German DJ Zedd. Eventually, the album was postponed to 2017, since Azelea claimed she experienced both personal and creative changes. In March 2017, she released the song "Mo Bounce" as a single, however the song was a commercial lackluster.
Quickly afterwards, Azalea teased a snippet of a song in an Instagram video with the caption: "IGGY X ANITTA" in early April, indicating that she was collaborating with Brazilian recording artist Anitta. Later in the same month, they were seen together in the studio to finish the track. Eventually, Azalea revealed that the track was called "Switch" by posting its cover art on 2 May 2017. In the cover art, she is "staring into the camera while wearing a one-piece maroon bathing suit," as described by Billboard's Gil Kaufman. It was released digitally on 19 May 2017 by Def Jam Recordings, and was sent to both contemporary hit radio and rhythmic contemporary radio on 23 May 2017.
"Switch" was recorded by Azalea in August 2016. However, she needed a female singer to sing its chorus and spent months trying to find a fitting voice, claiming she wanted to think outside the box. In a radio interview with Zach Sang, Azalea discussed the track, adding: "I couldn’t think of who should sing on this song with me because I just really wanted to bring another female energy. I didn’t really have any female collaborations yet on my album and I think people really enjoy me collaborating with other women and I wanted to make sure that I still did that." She continued talking, saying that a friend of hers suggested Anitta to sing the chorus. While watching Anitta videos on YouTube, she was impressed by her stage presence and dancing skills, and commented: "[...] I hit her up and asked if she would be interested in doing the song and it just kind of worked out perfectly." Anitta's part on the track was only recorded in February 2017, where Azalea helped her with the song's cadence and spelling of some words. In another interview, she described Anitta as a "very unapologetic and strong but super feminine. We clicked straight away."
Mike Wass of Idolator called it a "feel-good anthem," adding that "Switch" has a massive chorus, bone-rattling beats and endlessly quotable lyrics. It’s proof that the 26-year-old has finally discovered a sound that plays to her strengths." Joel Nolfi of Entertainment Weekly agreed, classifying it as "a summer-ready club banger" with an "easily danceable chorus." Lindsey India of XXL wrote that the song "could easily become a pop party anthem this summer, while Melody Chiu of People named it "powerful". Joshua Espinoza of Complex opined that the song "uses the same formula as Iggy’s breakout song "Fancy", noting that it has "infectious beat," a "catchy hook" and "cocky lyrics."
On May 26, 2017, Iggy and Anitta performed the single on The Tonight Show with Jimmy Fallon.
- This is the third single before the album's release, the first already being over a year old, as Iggy scrapped her old album and re-wrote almost every track.