The song was originally conceived during a studio session between Charli XCX, Ali Tamposi, Jack Patterson of Clean Bandit band, and Andrew Watt, the last of whom produced 'Señorita'. Out of the session they got ideas for melodies and lyrics, including the opening line, “I love it when you call me Señorita”.
Watt sent the song to Shawn Mendes, suggesting that the song be recorded as a duet, to which Mendes agreed and said that Camila Cabello would be the only person with whom he could do the song. Watt then sent the song to producers Benny Blanco and Cashmere Cat who decided to keep the song simple and make room for the vocals.
Mendes and Cabello both made changes to the melody and lyrics to their liking, most of the time working through video conferencing as they were either on tour or far from each other.
The producer Benny Blanco lauded their chemistry in the studio and praised their talent and the energy generated in the room. That's why it is such a hit.