The song was mixed by Serban Ghenea at MixStar Studios in Virginia Beach, Virginia and John Hanes served as a mix assistant. The song was mastered at Sterling Sound in New York City by Chris Gehringer. "Why" is a two minutes and fifty-one seconds synthesizer-driven electropop and dark pop song. According to the sheet music published at Musicnotes.com the song is composed in the time signature of common time with a moderate rate of 90 beats per minute. It is written in the key of B minor and follows the chord progression of G2-Em7-Bm7-A. Sabrina's vocal range spans from the low note A3 to the high note of B4, giving the song almost one octave of range. The tempo is relaxed. Originally, the bridge was a second part of the second verse. The song is backed by a hypnotic synthesizer loop and a finger-click beat and a slick beat at the chorus. Lyrically, "Why" talks about her and a guy being completely opposite, but they’re made for each other. Sabrina said that they started with the first line "You like New York City in the daytime / I like New York City in the nighttime" and once they found that line, they started going off on finding things that make people different from each other, but they’re not deal-breakers. In the line "You start your night sipping by the kilo / I don't I know you know" Carpenter is telling that her partner pre-game and she don't and in the line "Funny how the stars cross right" Carpenter is making a reference to Romeo and Juliet, once the song was inspired to a lot of films such as "When Harry Met Sally...", "Romeo and Juliet" and "10 Things I Hate About You". On July 16, 2017, Carpenter released a teaser of the music video on social media, which shows American actor Casey Cott and herself in a city, with Carpenter holding a camera. The video's release date was revealed in the caption. On July 19, 2017, she posted a compilation of the music video which shows her at a restaurant and in the streets of a city. In the same day, the video was premiered on Vevo and YouTube and the behind the scenes of the music video was premiered on September 9, 2017 in Sabrina's personal account. The music video was shot on June 20, 2017 in New York City by Jay Martin and explores the theme of opposites attracting, showing Carpenter and Cott maintaining their relationship despite being polar opposites.