After their 1980 album Duke
, Genesis changed the way they wrote songs. Instead of the individual members bringing in musical bits and song ideas to work on, the band would show up in the studio and come up with ideas collectively. According to Phil Collins, it was Mike Rutherford who came up with this song after getting the idea from his drum machine. Their keyboard player Tony Banks
added some chords, and Collins began improvising lyrics while they listened to playbacks, at one point uttering the word "Mama," which became the title for the song.
In a press conference following the release of the album, Collins said that when they wrote the song, it "had a lot of steam, a lot of heat," and they pictured Cuban brothels. The band didn't think much of the song when they wrote it, and were surprised when it caught on.