See, the song can be heard in two different keys. Most of the time it sounds as if it’s in the minor mode of A Aeolian*—the scale goes A B C D E F G—essentially, a form of A minor, which appears as the third of the four chords (“We’re up all night for good fun”).
But the first chord of the progression isn’t A minor, it’s D minor. The song slides smoothly back to it each time (“I’m up all night to get some”). The insistence of the D minor creates the aural illusion that the song could in fact be in the minor mode of D Dorian—D E F G A B C. Note that the D Dorian scale contains all the same notes as A Aeolian, all the same keys on the piano. The only difference is what key you start on.
So, when the chord cycle comes back around to the beginning, the D minor, each time, the ear is tricked for a moment into thinking that the song is in a different key, a musical Tilt-a-Whirl. I am not going to lie: To my ears the song is clearly identifiable as A minor, but on a Kinsey scale, I’d rate it a 3.
This Tilt-a-Whirl ambiguity is easy for the ear to discern and also easy to describe even without any musical background. Even untrained music writers typically will use the word “cyclical” or “spiraling" to describe this type of ambiguous progression. ...
Third observation: Daft Punk pulls off a classic move in this song during the bridge, at that moment when the chorus of robots breaks it down. The move? They overlay the hook from the pre-chorus with the hook from the chorus, getting them both going simultaneously. This is not an original device, but a classic one in the world of Western music theory, subject and countersubject. Two melodies that live separately but will join together in a climax of ecstatic melodic copulation.
Below is a transcription of the hook (robots) and pre-chorus (Pharrell). See how elegantly the rhythms counterbalance each other! One is busy and syncopated and repetitious, the other is straight and simple and has a nice long arc to it. And yet they’re both such strong hooks on their own! If these four bars appeared on a counterpoint exam, it would get impressive marks.
--Owen Pallett, Slate, on the thought behind the catchiness