"Black Widow" is a song by rapper Iggy Azalea, from her debut studio album, The New Classic and it's re-release Reclassified. It was written by Azalea, Katy Perry, Sarah Hudson, Benny Blanco, and duo StarGate; the latter also produced the song. Initially a track recorded by Perry for her fourth studio album Prism, the song was excluded from its tracklisting, however Perry handed the song to Azalea for her to complete. The song is influenced by snap and trap genres, containing an ominous steel drum rhythm, heavy bass and a sparse beat. The song's hook is sung by British recording artist Rita Ora, and its lyrics chronicle subjects of revenge and feminism in a failed romantic relationship. The song was serviced as the fourth official single of Azalea's album on July 8, 2014 becoming a commercial success.
Its composition has been the subject of music critics' comparisons to Perry's "Dark Horse" and other StarGate productions, some of which have been negative. Other journalists, however, praised its beat and Azalea and Ora's vocals. The song charted due to strong digital sales during the debut week of The New Classic. Accordingly, it achieved peaks of number 91 in the United Kingdom and number 86 in Australia, and appeared on several component charts. Azalea has performed the song live as part of the set list for her first headlining tour, The New Classic Tour.
In early 2013, Azalea made a friendship with American singer Katy Perry through Chris Anokute, an A&R at Azalea's record label Island Records. Anokute, who previously was an A&R for Perry at her label Capitol Records, told Azalea that Perry was a fan of her music. When Azalea was nominated at the 2013 MTV Video Music Awards, Anokute asked Perry if she could promote Azalea so that she could win votes in her category for Artist to Watch. Perry then took to Twitter to rave about Azalea's music, and Azalea later consulted Anokute about a future collaboration with Perry. Shortly afterward, Azalea and Perry begun working together with the latter's frequent collaborator Dr. Luke, but the collaboration proved unsuccessful. Azalea then heard about a song Perry recorded, "Black Widow", which was going to be given away to another artist. The song was initially written as a last-minute addition to Perry's fourth studio album, Prism, but the composition finalized only after the album's release. Perry's version included a chorus and verse. Azalea described the track as "a legend" and a "mysterious record", and tried to listen to the song through her label contacts, but she was later ignored.
"I've known Iggy for so many years. She supported me on my first tour. It was only an eight show tour in America. She only had 'Pussy' out at that time. I've always loved her vibe and her energy. I knew [her new album] was going to be a shock and it was a good shock, and I'm really happy for her. What we've done together is so cool and 'Black Widow' has an amazing message. We've always wanted to work together and we found the perfect song. It's all about women empowerment." — Rita Ora on collaborating with Azalea on the song.
On 4 June 2013, Azalea confirmed that British recording artist Rita Ora would feature on her debut studio The New Classic, after previously announcing Ora's feature on 26 December 2012. She stated, "I had a song in mind, and I need a woman with a big voice to sing the chorus because I can't do it". Azalea then asked Perry if she could record "Black Widow" for her album, which Perry then agreed to. The record, however, was never sent to Azalea and on 1 August 2013, she denied that Ora would be collaborating with her on the album. Azalea then met Perry for the first time, as her supporting act at the iTunes Festival that year. At the festival, Perry approached Azalea with an offer to record "Black Widow" as she felt the song would suit her better. Azalea was then invited to Perry's after party that night, where the two exchanged numbers, and Perry sent Azalea the record. When Azalea received the song, it only consisted of a hook and a beat. She initially wanted Perry to sing the song's hook, but Perry was unable to because of time constraints. In an interview, Azalea mentioned, "It needed someone who could really sing, as Katy's voice is awesome. The sky's the limit for Rita. Rita's a superstar and she will only get bigger. Rita is a great fit. Her voice can blow people away." Azalea and Ora then begun the recording "Black Widow" in November 2013 after the MTV Europe Music Awards, but only completed it in January 2014.
The final version of "Black Widow" was co-written by Azalea, Perry, Sarah Hudson, Benny Blanco, and its producers StarGate. Tim Blacksmith and Danny D. were responsible for the song's executive production and production co-ordination. StarGate provided the track's instrumentation and programming. Azalea and Ora recorded their vocals for the song at Record Plant and Westlake Recording Studios in Los Angeles, and Jungle City Studios in New York. Their vocals were engineered by Daniel Zaidenstadt and Eriksen, while Miles Walker was credited as the track's assistant vocal engineer. Phil Tan completed the mixing process at Ninja Club Studios in Atlanta, with the assistance of Daniela Rivera. The song was originally rumoured to be produced by both duo StarGate and Benny Blanco, though upon the release of the album, Blanco was only credited as a songwriter.
On 26 February 2014, in an interview with Los Angeles radio station Power 106, Azalea stated that the album's fifth single would be written by Perry and feature an undisclosed female artist. A 90-second preview of "Black Widow" was released on 11 April 2014. The song's full version then leaked online on 17 April 2014, five days prior to the release of The New Classic on 22 April 2014